Class InterfaceAdapter<T>

  • All Implemented Interfaces:
    com.google.gson.JsonDeserializer<T>, com.google.gson.JsonSerializer

    public class InterfaceAdapter<T>
    extends java.lang.Object
    implements com.google.gson.JsonSerializer, com.google.gson.JsonDeserializer<T>
    Created by Ken on 2016/10/25.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T deserialize​(com.google.gson.JsonElement jsonElement, java.lang.reflect.Type type, com.google.gson.JsonDeserializationContext jsonDeserializationContext)  
      com.google.gson.JsonElement serialize​(java.lang.Object object, java.lang.reflect.Type type, com.google.gson.JsonSerializationContext jsonSerializationContext)  
      • Methods inherited from class java.lang.Object

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

      • InterfaceAdapter

        public InterfaceAdapter()
    • Method Detail

      • deserialize

        public T deserialize​(com.google.gson.JsonElement jsonElement,
                             java.lang.reflect.Type type,
                             com.google.gson.JsonDeserializationContext jsonDeserializationContext)
                      throws com.google.gson.JsonParseException
        Specified by:
        deserialize in interface com.google.gson.JsonDeserializer<T>
        Throws:
        com.google.gson.JsonParseException
      • serialize

        public com.google.gson.JsonElement serialize​(java.lang.Object object,
                                                     java.lang.reflect.Type type,
                                                     com.google.gson.JsonSerializationContext jsonSerializationContext)
        Specified by:
        serialize in interface com.google.gson.JsonSerializer<T>