public class JsonRedisSerializer extends Object implements org.springframework.data.redis.serializer.RedisSerializer<Object>
JSON Redis serializer which serializes/deserializes given Class
es to JSON and back.
In addition to the normal object serialization/deserialization support, this class can also handle byte arrays. The byte arrays are stored directly, without any JSON transformation, which make them suitable to store big objects with good performance.
Any modification of this class may make any existing cache unusable, breaking the edoras one instance. Any change must be backwards compatible or must provide a patch to upgrade the existing caches.
Constructor and Description |
---|
JsonRedisSerializer(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
List<Class<?>> regularTypes,
List<Class<?>> listTypes)
The given object mapper must be able to serialize/deserialize the given classes.
|
public JsonRedisSerializer(com.fasterxml.jackson.databind.ObjectMapper objectMapper, List<Class<?>> regularTypes, List<Class<?>> listTypes)
The given object mapper must be able to serialize/deserialize the given classes.
objectMapper
- the Jackson object mapperregularTypes
- the classes to serialize/deserializelistTypes
- the classes that may be contained in a list to serialize/deserializepublic Object deserialize(byte[] bytes) throws org.springframework.data.redis.serializer.SerializationException
deserialize
in interface org.springframework.data.redis.serializer.RedisSerializer<Object>
org.springframework.data.redis.serializer.SerializationException
Copyright © 2010 - 2019 edorasware ag. All Rights Reserved.