V
- The value typepublic abstract class CacheSerializer<V>
extends java.lang.Object
CacheSerializer
is used to serialize a V
value to a N-length byte array.Constructor and Description |
---|
CacheSerializer()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract byte[] |
serialize(V obj)
Serialize a
V object into a byte[]. |
public abstract byte[] serialize(V obj) throws SerializationException
V
object into a byte[].
When implementing serialize(Object)
, wrap the serialization logic in a try/catch
block that rethrows any exception
as a SerializationException
so that synchronous Cache
methods will rethrow the CacheException
and
asynchronous request's CompletableFuture
will complete exceptionally.
obj
- a V
objectSerializationException
- if an exception occurs during serialization