Class JsonDeserializeEnumFromInt<T>

java.lang.Object
com.c1games.terminal.algo.serialization.JsonDeserializeEnumFromInt<T>
All Implemented Interfaces:
com.google.gson.JsonDeserializer<T>

public class JsonDeserializeEnumFromInt<T>
extends java.lang.Object
implements com.google.gson.JsonDeserializer<T>
GSON deserializer which deserializes an enum from an integer, simply producing the variant of the enum with the index that corresponds to the JSON iterator.
  • Constructor Summary

    Constructors 
    Constructor Description
    JsonDeserializeEnumFromInt​(java.lang.Class<T> typeClass)  
  • Method Summary

    Modifier and Type Method Description
    T deserialize​(com.google.gson.JsonElement jsonElement, java.lang.reflect.Type type, com.google.gson.JsonDeserializationContext jsonDeserializationContext)  

    Methods inherited from class java.lang.Object

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

  • Method Details

    • 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