All Downloads are FREE. Search and download functionalities are using the official Maven repository.

redis.clients.jedis.json.DefaultGsonObjectMapper Maven / Gradle / Ivy

The newest version!
package redis.clients.jedis.json;

import com.google.gson.Gson;

/**
 * Use the default {@link Gson} configuration for serialization and deserialization JSON
 * operations.
 * 

When none is explicitly set, this will be set.

* @see JsonObjectMapper Create a custom JSON serializer/deserializer */ public class DefaultGsonObjectMapper implements JsonObjectMapper { /** * Instance of Gson object with default gson configuration. */ private final Gson gson = new Gson(); @Override public T fromJson(String value, Class valueType) { return gson.fromJson(value, valueType); } @Override public String toJson(Object value) { return gson.toJson(value); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy