Class JsonDeserializeClassFromTuple<T>
java.lang.Object
com.c1games.terminal.algo.serialization.JsonDeserializeClassFromTuple<T>
- All Implemented Interfaces:
com.google.gson.JsonDeserializer<T>
public class JsonDeserializeClassFromTuple<T>
extends java.lang.Object
implements com.google.gson.JsonDeserializer<T>
GSON deserializer that deserializes a class from an array, deserializing each the value of each field, in order, from that corresponding
index in the array. Ignores static, final, and transient fields.
-
Constructor Summary
Constructors Constructor Description JsonDeserializeClassFromTuple(java.lang.Class<T> typeClass, java.util.function.Supplier<T> typeFactory)
-
Method Summary
Modifier and Type Method Description T
deserialize(com.google.gson.JsonElement jsonElement, java.lang.reflect.Type type, com.google.gson.JsonDeserializationContext jsonDeserializationContext)
-
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 interfacecom.google.gson.JsonDeserializer<T>
- Throws:
com.google.gson.JsonParseException
-