redis.clients.jedis.json.JsonObjectMapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jedis_preview Show documentation
Show all versions of jedis_preview Show documentation
Jedis is a blazingly small and sane Redis java client.
The newest version!
package redis.clients.jedis.json;
/**
* Represents the ability of serialize an object to JSON format string and deserialize it to the
* typed object.
* @see DefaultGsonObjectMapper Default implementation for JSON serializer/deserializer
* engine with com.google.gson.Gson
*/
public interface JsonObjectMapper {
/**
* Perform deserialization from JSON format string to the given type object as argument.
* @param value the JSON format
* @param valueType the object type to convert
* @param the type object to convert
* @return the instance of an object to the type given argument
*/
T fromJson(String value, Class valueType);
/**
* Perform serialization from object to JSON format string.
* @param value the object to convert
* @return the JSON format string
*/
String toJson(Object value);
}