public final class DefaultImplementationTypeAdapterFactory<S,T extends S> extends Object implements com.google.gson.TypeAdapterFactory
TypeAdapterFactory implementation, which creates TypeAdapters that for any subclass of S, fixes the
serialization and deserialization to unique class T.
Does not matter which subclass of S is found, this factory will create TypeAdapters of T type.
| Constructor and Description |
|---|
DefaultImplementationTypeAdapterFactory(Class<S> superClass,
Class<T> clazz) |
| Modifier and Type | Method and Description |
|---|---|
<C> com.google.gson.TypeAdapter<C> |
create(com.google.gson.Gson gson,
com.google.gson.reflect.TypeToken<C> type) |
public DefaultImplementationTypeAdapterFactory(Class<S> superClass, Class<T> clazz)
superClass - class that will be used to look for implementations of it, at serialization and deserialization timeclazz - class to fix the serialization or deserializationpublic <C> com.google.gson.TypeAdapter<C> create(com.google.gson.Gson gson,
com.google.gson.reflect.TypeToken<C> type)
create in interface com.google.gson.TypeAdapterFactoryC - type of objects that the TypeAdapter will creategson - The actual Gson serializertype - Implementation that Gson is trying to find a TypeAdaptersuperClass a TypeAdapter, that serializes and deserialize C
instancesCopyright © 2022. All rights reserved.