Class GenericToStringSerializer<T>

java.lang.Object
org.springframework.data.redis.serializer.GenericToStringSerializer<T>
All Implemented Interfaces:
Aware, BeanFactoryAware, RedisSerializer<T>

public class GenericToStringSerializer<T> extends Object implements RedisSerializer<T>, BeanFactoryAware
Generic String to byte[] (and back) serializer. Relies on the Spring ConversionService to transform objects into String and vice versa. The Strings are convert into bytes and vice-versa using the specified charset (by default UTF-8). Note: The conversion service initialization happens automatically if the class is defined as a Spring bean. Note: Does not handle nulls in any special way delegating everything to the container.
Author:
Costin Leau, Christoph Strobl, Mark Paluch
  • Constructor Details

    • GenericToStringSerializer

      public GenericToStringSerializer(Class<T> type)
    • GenericToStringSerializer

      public GenericToStringSerializer(Class<T> type, Charset charset)
  • Method Details