Package com.google.gson.internal.bind
Class MapTypeAdapterFactory.Adapter<K,V>
java.lang.Object
com.google.gson.TypeAdapter<Map<K,V>>
com.google.gson.internal.bind.MapTypeAdapterFactory.Adapter<K,V>
- Enclosing class:
- MapTypeAdapterFactory
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ObjectConstructor<? extends Map<K,
V>> private final TypeAdapter<K>
private final TypeAdapter<V>
-
Constructor Summary
ConstructorsConstructorDescriptionAdapter
(Gson context, Type keyType, TypeAdapter<K> keyTypeAdapter, Type valueType, TypeAdapter<V> valueTypeAdapter, ObjectConstructor<? extends Map<K, V>> constructor) -
Method Summary
Modifier and TypeMethodDescriptionprivate String
keyToString
(JsonElement keyElement) 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, Map<K, V> map) Writes one JSON value (an array, object, string, number, boolean or null) forvalue
.Methods inherited from class com.google.gson.TypeAdapter
fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree
-
Field Details
-
keyTypeAdapter
-
valueTypeAdapter
-
constructor
-
-
Constructor Details
-
Adapter
public Adapter(Gson context, Type keyType, TypeAdapter<K> keyTypeAdapter, Type valueType, TypeAdapter<V> valueTypeAdapter, ObjectConstructor<? extends Map<K, V>> constructor)
-
-
Method Details
-
read
Description copied from class:TypeAdapter
Reads one JSON value (an array, object, string, number, boolean or null) and converts it to a Java object. Returns the converted object.- Specified by:
read
in classTypeAdapter<Map<K,
V>> - Returns:
- the converted Java object. May be null.
- Throws:
IOException
-
write
Description copied from class:TypeAdapter
Writes one JSON value (an array, object, string, number, boolean or null) forvalue
.- Specified by:
write
in classTypeAdapter<Map<K,
V>> map
- the Java object to write. May be null.- Throws:
IOException
-
keyToString
-