public class GenericJackson2JsonRedisSerializer extends Object implements RedisSerializer<Object>
| Constructor and Description |
|---|
GenericJackson2JsonRedisSerializer()
Creates
GenericJackson2JsonRedisSerializer and configures ObjectMapper for default typing. |
GenericJackson2JsonRedisSerializer(com.fasterxml.jackson.databind.ObjectMapper mapper)
Setting a custom-configured
ObjectMapper is one way to take further control of the JSON serialization
process. |
GenericJackson2JsonRedisSerializer(String classPropertyTypeName)
Creates
GenericJackson2JsonRedisSerializer and configures ObjectMapper for default typing using the
given name. |
| Modifier and Type | Method and Description |
|---|---|
Object |
deserialize(byte[] source)
Deserialize an object from the given binary data.
|
<T> T |
deserialize(byte[] source,
Class<T> type) |
byte[] |
serialize(Object source)
Serialize the given object to binary data.
|
public GenericJackson2JsonRedisSerializer()
GenericJackson2JsonRedisSerializer and configures ObjectMapper for default typing.public GenericJackson2JsonRedisSerializer(String classPropertyTypeName)
GenericJackson2JsonRedisSerializer and configures ObjectMapper for default typing using the
given name. In case of an empty or null String the default
JsonTypeInfo.Id#CLASS will be used.classPropertyTypeName - Name of the JSON property holding type information. Can be null.public GenericJackson2JsonRedisSerializer(com.fasterxml.jackson.databind.ObjectMapper mapper)
ObjectMapper is one way to take further control of the JSON serialization
process. For example, an extended SerializerFactory can be configured that provides custom serializers for
specific types.mapper - must not be null.public byte[] serialize(Object source) throws SerializationException
RedisSerializerserialize in interface RedisSerializer<Object>source - object to serializeSerializationExceptionpublic Object deserialize(byte[] source) throws SerializationException
RedisSerializerdeserialize in interface RedisSerializer<Object>source - object binary representationSerializationExceptionpublic <T> T deserialize(byte[] source,
Class<T> type)
throws SerializationException
source - can be null.type - must not be null.SerializationException