Package com.scaleout.client.caching
Class CacheSerializer<V>
java.lang.Object
com.scaleout.client.caching.CacheSerializer<V>
- Type Parameters:
V
- The value type
- Direct Known Subclasses:
CacheValueSerializer
The
CacheSerializer
is used to serialize a V
value to a N-length byte array.-
Constructor Summary
-
Method Summary
-
Constructor Details
-
CacheSerializer
public CacheSerializer()Default constructor.
-
-
Method Details
-
serialize
Serialize aV
object into a byte[].When implementing
serialize(Object)
, wrap the serialization logic in atry/catch
block that rethrows any exception as aSerializationException
so that synchronousCache
methods will rethrow theCacheException
and asynchronous request'sCompletableFuture
will complete exceptionally.- Parameters:
obj
- aV
object- Returns:
- the serialized object
- Throws:
SerializationException
- if an exception occurs during serialization
-