Class GsonSerializer
- java.lang.Object
-
- com.github.kagkarlsson.scheduler.serializer.GsonSerializer
-
- All Implemented Interfaces:
Serializer
public class GsonSerializer extends Object implements Serializer
-
-
Field Summary
Fields Modifier and Type Field Description static Charset
CHARSET
-
Fields inherited from interface com.github.kagkarlsson.scheduler.serializer.Serializer
DEFAULT_JAVA_SERIALIZER
-
-
Constructor Summary
Constructors Constructor Description GsonSerializer()
GsonSerializer(com.google.gson.Gson gson)
GsonSerializer(Consumer<com.google.gson.GsonBuilder> gsonCustomizer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
deserialize(Class<T> clazz, byte[] serializedData)
static com.google.gson.GsonBuilder
getDefaultGson()
byte[]
serialize(Object object)
-
-
-
Field Detail
-
CHARSET
public static final Charset CHARSET
-
-
Constructor Detail
-
GsonSerializer
public GsonSerializer()
-
GsonSerializer
public GsonSerializer(com.google.gson.Gson gson)
-
GsonSerializer
public GsonSerializer(Consumer<com.google.gson.GsonBuilder> gsonCustomizer)
-
-
Method Detail
-
getDefaultGson
public static com.google.gson.GsonBuilder getDefaultGson()
-
serialize
public byte[] serialize(Object object)
- Specified by:
serialize
in interfaceSerializer
-
deserialize
public <T> T deserialize(Class<T> clazz, byte[] serializedData)
- Specified by:
deserialize
in interfaceSerializer
-
-