Package ch.njol.util

Class EnumTypeAdapter<T extends Enum<T>>

java.lang.Object
com.google.gson.TypeAdapter<T>
ch.njol.util.EnumTypeAdapter<T>

public final class EnumTypeAdapter<T extends Enum<T>> extends com.google.gson.TypeAdapter<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static com.google.gson.TypeAdapterFactory
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    EnumTypeAdapter​(Class<T> classOfT)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    read​(com.google.gson.stream.JsonReader in)
     
    void
    write​(com.google.gson.stream.JsonWriter out, T value)
     

    Methods inherited from class com.google.gson.TypeAdapter

    fromJson, fromJson, fromJsonTree, nullSafe, toJson, toJson, toJsonTree

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • factory

      public static final com.google.gson.TypeAdapterFactory factory
  • Constructor Details

    • EnumTypeAdapter

      public EnumTypeAdapter(Class<T> classOfT)
  • Method Details

    • read

      public T read(com.google.gson.stream.JsonReader in) throws IOException
      Specified by:
      read in class com.google.gson.TypeAdapter<T extends Enum<T>>
      Throws:
      IOException
    • write

      public void write(com.google.gson.stream.JsonWriter out, T value) throws IOException
      Specified by:
      write in class com.google.gson.TypeAdapter<T extends Enum<T>>
      Throws:
      IOException