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, toJsonTree
private 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
TypeAdapter
read
in class TypeAdapter<T>
java.io.IOException
public void write(JsonWriter out, T value) throws java.io.IOException
TypeAdapter
value
.write
in class TypeAdapter<T>
value
- the Java object to write. May be null.java.io.IOException
private java.lang.reflect.Type getRuntimeTypeIfMoreSpecific(java.lang.reflect.Type type, java.lang.Object value)