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 Details

    • EmptyArrayAdapterFactory

      public EmptyArrayAdapterFactory(Class<C> customizedClass)
      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:
      create in interface com.google.gson.TypeAdapterFactory
      Type Parameters:
      T - The type to adapt.
      Parameters:
      gson - The current Gson instance.
      type - The type token to adapt.
      Returns:
      The fixed adapter.