public final class RestrictiveTypeAdapterFactory<SpecificClass,ImplementationClass extends SpecificClass> extends Object implements com.google.gson.TypeAdapterFactory
TypeAdapterFactory implementation, which creates TypeAdapters that only for a class of type SpecificClass,
fixes the serialization and deserialization to a unique class ImplementationClass.| Constructor and Description |
|---|
RestrictiveTypeAdapterFactory(Class<SpecificClass> specificClass,
Class<ImplementationClass> clazz) |
| Modifier and Type | Method and Description |
|---|---|
<ImplementationClass> |
create(com.google.gson.Gson gson,
com.google.gson.reflect.TypeToken<ImplementationClass> type) |
public RestrictiveTypeAdapterFactory(Class<SpecificClass> specificClass, Class<ImplementationClass> clazz)
specificClass - class to look for at serialization and deserialization time.clazz - class to fix the serialization or deserializationpublic <ImplementationClass> com.google.gson.TypeAdapter<ImplementationClass> create(com.google.gson.Gson gson,
com.google.gson.reflect.TypeToken<ImplementationClass> type)
create in interface com.google.gson.TypeAdapterFactoryImplementationClass - type of objects that the TypeAdapter will creategson - The actual Gson serializertype - Implementation that GSON is trying to find a TypeAdapterclazz a TypeAdapter, that serializes and deserialize
ImplementationClass instancesCopyright © 2016 MuleSoft, Inc.. All rights reserved.