Package redis.clients.jedis.json
Class DefaultGsonObjectMapper
java.lang.Object
redis.clients.jedis.json.DefaultGsonObjectMapper
- All Implemented Interfaces:
JsonObjectMapper
Use the default
Gson configuration for serialization and deserialization JSON
operations.
When none is explicitly set, this will be set.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.gson.GsonInstance of Gson object with default gson configuration. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
gson
private final com.google.gson.Gson gsonInstance of Gson object with default gson configuration.
-
-
Constructor Details
-
DefaultGsonObjectMapper
public DefaultGsonObjectMapper()
-
-
Method Details
-
fromJson
Description copied from interface:JsonObjectMapperPerform deserialization from JSON format string to the given type object as argument.- Specified by:
fromJsonin interfaceJsonObjectMapper- Type Parameters:
T- the type object to convert- Parameters:
value- the JSON formatvalueType- the object type to convert- Returns:
- the instance of an object to the type given argument
-
toJson
Description copied from interface:JsonObjectMapperPerform serialization from object to JSON format string.- Specified by:
toJsonin interfaceJsonObjectMapper- Parameters:
value- the object to convert- Returns:
- the JSON format string
-