Class ExtraTypeAdapter<T>
java.lang.Object
com.google.gson.TypeAdapter<T>
me.bristermitten.mittenlib.files.json.ExtraTypeAdapter<T>
- Type Parameters:
T- the type of the TypeAdapter
- Direct Known Subclasses:
DataTreeTypeAdapter
public abstract class ExtraTypeAdapter<T>
extends com.google.gson.TypeAdapter<T>
A thin wrapper over a
TypeAdapter that also stores the type it is for. This is necessary
for dynamic binding as Gson does not provide a way to get the type of a TypeAdapter, but requires
it for registering (GsonBuilder.registerTypeAdapter(Type, Object)).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ExtraTypeAdapter<T> Creates anExtraTypeAdapterfrom an existingTypeAdapter.abstract Typetype()Get the type that thisExtraTypeAdapteris for.Methods inherited from class com.google.gson.TypeAdapter
fromJson, fromJson, fromJsonTree, nullSafe, read, toJson, toJson, toJsonTree, write
-
Constructor Details
-
ExtraTypeAdapter
public ExtraTypeAdapter()
-
-
Method Details
-
of
Creates anExtraTypeAdapterfrom an existingTypeAdapter.- Type Parameters:
T- the type of the TypeAdapter- Parameters:
type- the type of the TypeAdapteradapter- the TypeAdapter- Returns:
- the ExtraTypeAdapter
-
type
Get the type that thisExtraTypeAdapteris for.- Returns:
- The type that this
ExtraTypeAdapteris for.
-