Class JSONAdapterFactory<T>

  • Type Parameters:
    T - the type of data that will be serialized and/or deserialized
    All Implemented Interfaces:
    com.google.gson.TypeAdapterFactory

    public abstract class JSONAdapterFactory<T>
    extends java.lang.Object
    implements com.google.gson.TypeAdapterFactory
    A type-safe TypeAdapterFactory. This is preferable to using just a simple TypeAdapter because you can access the underlying Gson instance, so nested objects can be handled by other adapters that are registered wit that Gson instance.
    • Constructor Detail

      • JSONAdapterFactory

        public JSONAdapterFactory()
    • Method Detail

      • typeToken

        @NotNull
        protected abstract @NotNull com.google.gson.reflect.TypeToken<T> typeToken()
      • create

        public final <T1> com.google.gson.TypeAdapter<T1> create​(com.google.gson.Gson gson,
                                                                 com.google.gson.reflect.TypeToken<T1> typeToken)
        Specified by:
        create in interface com.google.gson.TypeAdapterFactory