Package com.helixframework.cache
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 TypeMethodDescription<T2> T2deserialize(String value) Deserializes a string representation back into an object.Serializes an object into its string representation.default booleanChecks if this serializer supports the given class type.
-
Method Details
-
serialize
Serializes an object into its string representation.- Parameters:
value- the object to serialize- Returns:
- the string representation of the object
-
deserialize
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
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
-