final class TypeAdapterRuntimeTypeWrapper<T> extends TypeAdapter<T>
| Modifier and Type | Field and Description |
|---|---|
private Gson |
context |
private TypeAdapter<T> |
delegate |
private java.lang.reflect.Type |
type |
| Constructor and Description |
|---|
TypeAdapterRuntimeTypeWrapper(Gson context,
TypeAdapter<T> delegate,
java.lang.reflect.Type type) |
| Modifier and Type | Method and Description |
|---|---|
private java.lang.reflect.Type |
getRuntimeTypeIfMoreSpecific(java.lang.reflect.Type type,
java.lang.Object value)
Finds a compatible runtime type if it is more specific
|
T |
read(JsonReader in)
Reads one JSON value (an array, object, string, number, boolean or null)
and converts it to a Java object.
|
void |
write(JsonWriter out,
T value)
Writes one JSON value (an array, object, string, number, boolean or null)
for
value. |
fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTreeprivate final Gson context
private final TypeAdapter<T> delegate
private final java.lang.reflect.Type type
TypeAdapterRuntimeTypeWrapper(Gson context, TypeAdapter<T> delegate, java.lang.reflect.Type type)
public T read(JsonReader in) throws java.io.IOException
TypeAdapterread in class TypeAdapter<T>java.io.IOExceptionpublic void write(JsonWriter out, T value) throws java.io.IOException
TypeAdaptervalue.write in class TypeAdapter<T>value - the Java object to write. May be null.java.io.IOExceptionprivate java.lang.reflect.Type getRuntimeTypeIfMoreSpecific(java.lang.reflect.Type type,
java.lang.Object value)