Interface CacheValueSerializer<T>

Type Parameters:
T - the type of objects that can be serialized

public interface CacheValueSerializer<T>
Interface for serializing and deserializing cache values. Implementations should provide methods to convert objects to and from string representation for storage in cache systems.
  • Method Summary

    Modifier and Type
    Method
    Description
    <T2> T2
    Deserializes a string representation back into an object.
    serialize(T value)
    Serializes an object into its string representation.
    default boolean
    supports(Class<?> clazz)
    Checks if this serializer supports the given class type.
  • Method Details

    • serialize

      String serialize(T value)
      Serializes an object into its string representation.
      Parameters:
      value - the object to serialize
      Returns:
      the string representation of the object
    • deserialize

      <T2> T2 deserialize(String value)
      Deserializes a string representation back into an object.
      Type Parameters:
      T2 - the type of object to deserialize into
      Parameters:
      value - the string representation to deserialize
      Returns:
      the deserialized object
    • supports

      default boolean supports(Class<?> clazz)
      Checks if this serializer supports the given class type. Default implementation returns true for all classes.
      Parameters:
      clazz - the class to check for support
      Returns:
      true if this serializer supports the given class, false otherwise