private static final class CollectionTypeAdapterFactory.Adapter<E> extends TypeAdapter<java.util.Collection<E>>
Modifier and Type | Field and Description |
---|---|
private ObjectConstructor<? extends java.util.Collection<E>> |
constructor |
private TypeAdapter<E> |
elementTypeAdapter |
Constructor and Description |
---|
Adapter(Gson context,
java.lang.reflect.Type elementType,
TypeAdapter<E> elementTypeAdapter,
ObjectConstructor<? extends java.util.Collection<E>> constructor) |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<E> |
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,
java.util.Collection<E> collection)
Writes one JSON value (an array, object, string, number, boolean or null)
for
value . |
fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree
private final TypeAdapter<E> elementTypeAdapter
private final ObjectConstructor<? extends java.util.Collection<E>> constructor
public Adapter(Gson context, java.lang.reflect.Type elementType, TypeAdapter<E> elementTypeAdapter, ObjectConstructor<? extends java.util.Collection<E>> constructor)
public java.util.Collection<E> read(JsonReader in) throws java.io.IOException
TypeAdapter
read
in class TypeAdapter<java.util.Collection<E>>
java.io.IOException
public void write(JsonWriter out, java.util.Collection<E> collection) throws java.io.IOException
TypeAdapter
value
.write
in class TypeAdapter<java.util.Collection<E>>
collection
- the Java object to write. May be null.java.io.IOException