Class BaseCollectionDeserializer<E>
java.lang.Object
com.github.natche.gravatarjavaclient.profile.gson.BaseCollectionDeserializer<E>
- Type Parameters:
E- the entity type
- All Implemented Interfaces:
com.google.gson.JsonDeserializer<E>
- Direct Known Subclasses:
ImmutableListDeserializer
public abstract class BaseCollectionDeserializer<E>
extends Object
implements com.google.gson.JsonDeserializer<E>
A collection deserializer for use by
Gson
to deserialize a collection token into an ImmutableList.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract EbuildFrom(Collection<?> collection) deserialize(com.google.gson.JsonElement json, Type type, com.google.gson.JsonDeserializationContext context) Deserializes the provided JSON element.
-
Constructor Details
-
BaseCollectionDeserializer
public BaseCollectionDeserializer()
-
-
Method Details
-
buildFrom
-
deserialize
public E deserialize(com.google.gson.JsonElement json, Type type, com.google.gson.JsonDeserializationContext context) Deserializes the provided JSON element.- Specified by:
deserializein interfacecom.google.gson.JsonDeserializer<E>- Parameters:
json- The Json data being deserializedtype- The type of the Object to deserialize tocontext- tge deserialization context- Returns:
- the deserialized object, collection in this case
-