Class TEnumTypeAdapterFactory

  • All Implemented Interfaces:
    com.google.gson.TypeAdapterFactory

    public class TEnumTypeAdapterFactory
    extends java.lang.Object
    implements com.google.gson.TypeAdapterFactory
    Special handling of TEnum serialization and deserialization. This is to support for inline TEnum fields in Java class. The default gson serde serialize the TEnum with its String name representation, this adapter serialize the TEnum class with its int representation.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T> com.google.gson.TypeAdapter<T> create​(com.google.gson.Gson gson, com.google.gson.reflect.TypeToken<T> typeToken)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TEnumTypeAdapterFactory

        public TEnumTypeAdapterFactory()
    • Method Detail

      • create

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