Class GsonSerializer
java.lang.Object
io.github.projectunified.faststats.gson.GsonSerializer
- All Implemented Interfaces:
Serializer
An implementation of
Serializer that uses Google Gson.-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newGsonSerializerwith a defaultGsoninstance.GsonSerializer(com.google.gson.Gson gson) Constructs a newGsonSerializerwith the specifiedGsoninstance. -
Method Summary
-
Constructor Details
-
GsonSerializer
public GsonSerializer()Constructs a newGsonSerializerwith a defaultGsoninstance. -
GsonSerializer
public GsonSerializer(com.google.gson.Gson gson) Constructs a newGsonSerializerwith the specifiedGsoninstance.- Parameters:
gson- the Gson instance to use
-
-
Method Details
-
serialize
Description copied from interface:SerializerSerializes the given telemetry map into its JSON representation.- Specified by:
serializein interfaceSerializer- Parameters:
value- the telemetry map to serialize- Returns:
- the serialized JSON string
- Throws:
Exception- if serialization fails
-