Package de.femtopedia.studip.util.fix
Class EmptyArrayAdapterFactory<C>
java.lang.Object
de.femtopedia.studip.util.fix.EmptyArrayAdapterFactory<C>
- Type Parameters:
C- The class type to adapt.
- All Implemented Interfaces:
com.google.gson.TypeAdapterFactory
public class EmptyArrayAdapterFactory<C>
extends Object
implements com.google.gson.TypeAdapterFactory
Class representing an adapter factory for fixing empty arrays being used as
empty Objects in JSON files.
-
Constructor Summary
ConstructorsConstructorDescriptionEmptyArrayAdapterFactory(Class<C> customizedClass) Initializes a default factory instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal <T> com.google.gson.TypeAdapter<T>create(com.google.gson.Gson gson, com.google.gson.reflect.TypeToken<T> type) Creates an instance for adapting the given token.
-
Constructor Details
-
EmptyArrayAdapterFactory
Initializes a default factory instance.- Parameters:
customizedClass- The class to adapt.
-
-
Method Details
-
create
public final <T> com.google.gson.TypeAdapter<T> create(com.google.gson.Gson gson, com.google.gson.reflect.TypeToken<T> type) Creates an instance for adapting the given token.- Specified by:
createin interfacecom.google.gson.TypeAdapterFactory- Type Parameters:
T- The type to adapt.- Parameters:
gson- The currentGsoninstance.type- The type token to adapt.- Returns:
- The fixed adapter.
-