Interface JsonSerializer<T>
public interface JsonSerializer<T>
-
Method Summary
Modifier and TypeMethodDescriptionGets theSerializerDescriptor
of the object this serializer serializes.default T
deserialize
(com.google.gson.JsonElement json) Deserializes from aJsonElement
to the object.Deserializes from aJsonElement
to the object.com.google.gson.JsonElement
Serializes from a object to aJsonElement
.
-
Method Details
-
descriptor
SerializerDescriptor descriptor()Gets theSerializerDescriptor
of the object this serializer serializes.- Returns:
- the
SerializerDescriptor
-
serialize
Serializes from a object to aJsonElement
.- Parameters:
obj
- the object to serialize- Returns:
- the serialized object as a
JsonElement
-
deserializePath
Deserializes from aJsonElement
to the object.- Parameters:
json
- theJsonElement
to deserialize into a object- Returns:
- the deserialized object from the
JsonElement
-
deserialize
Deserializes from aJsonElement
to the object.- Parameters:
json
- theJsonElement
to deserialize into a object- Returns:
- the deserialized object from the
JsonElement
-