Class JdkSerializationRedisSerializer

java.lang.Object
org.springframework.data.redis.serializer.JdkSerializationRedisSerializer
All Implemented Interfaces:
RedisSerializer<Object>

public class JdkSerializationRedisSerializer extends Object implements RedisSerializer<Object>
Java Serialization RedisSerializer.

Delegates to the default (Java-based) serializer and deserializer.

This serializer can be constructed with either a custom ClassLoader or custom converters.

Author:
Mark Pollack, Costin Leau, Mark Paluch, Christoph Strobl, John Blum
  • Constructor Details

  • Method Details

    • serialize

      public byte[] serialize(@Nullable Object value)
      Description copied from interface: RedisSerializer
      Serialize the given object to binary data.
      Specified by:
      serialize in interface RedisSerializer<Object>
      Parameters:
      value - object to serialize. Can be null.
      Returns:
      the equivalent binary data. Can be an empty array but never null.
    • deserialize

      public @Nullable Object deserialize(byte @Nullable [] bytes)
      Description copied from interface: RedisSerializer
      Deserialize an object from the given binary data.
      Specified by:
      deserialize in interface RedisSerializer<Object>
      Parameters:
      bytes - object binary representation. Can be null.
      Returns:
      the equivalent object instance. Can be null.