org.springframework.data.redis.serializer
Interface RedisSerializer<T>

All Known Implementing Classes:
GenericToStringSerializer, JacksonJsonRedisSerializer, JdkSerializationRedisSerializer, OxmSerializer, StringRedisSerializer

public interface RedisSerializer<T>

Basic interface serialization and deserialization of Objects to byte arrays (binary data). It is recommended that implementations are designed to handle null objects/empty arrays on serialization and deserialization side. Note that Redis does not accept null keys or values but can return null replies (for non existing keys).


Method Summary
 T deserialize(byte[] bytes)
          Deserialize an object from the given binary data.
 byte[] serialize(T t)
          Serialize the given object to binary data.
 

Method Detail

serialize

byte[] serialize(T t)
                 throws SerializationException
Serialize the given object to binary data.

Parameters:
t - object to serialize
Returns:
the equivalent binary data
Throws:
SerializationException

deserialize

T deserialize(byte[] bytes)
              throws SerializationException
Deserialize an object from the given binary data.

Parameters:
bytes - object binary representation
Returns:
the equivalent object instance
Throws:
SerializationException