Spring Data Key-Value

org.springframework.data.keyvalue.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.

Author:
Mark Pollack, Costin Leau

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

Spring Data Key-Value

Copyright © 2010-2011 SpringSource. All Rights Reserved.