T - the type of the instances to serializepublic interface Serializer<T>
ClassLoader parameter: This constructor will be used to initialize the serializer for
transient caches
ClassLoader parameter and a file based persistence context: This constructor will be used to
initialize the serializer for persistent caches
The serialized object's class must be preserved in such a way that deserializing that object will return an object of the exact same class as before serialization, i.e.: the following contract must always be true:
object.getClass().equals( mySerializer.read(mySerializer.serialize(object)).getClass() )
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(T object,
java.nio.ByteBuffer binary)
Checks if the given instance and serial form are representations of the same instance.
|
T |
read(java.nio.ByteBuffer binary)
Reconstructs an instance from the given serial form.
|
java.nio.ByteBuffer |
serialize(T object)
Transforms the given instance into its serial form.
|
java.nio.ByteBuffer serialize(T object) throws SerializerException
object - the instance to serializeSerializerException - if serialization failsT read(java.nio.ByteBuffer binary) throws java.lang.ClassNotFoundException, SerializerException
binary - the binary representation of the serial formSerializerException - if reading the byte buffer failsjava.lang.ClassNotFoundException - if the type to de-serialize to cannot be foundboolean equals(T object, java.nio.ByteBuffer binary) throws java.lang.ClassNotFoundException, SerializerException
object - the instance to checkbinary - the serial form to checktrue if both parameters represent the same instance, false otherwiseSerializerException - if reading the byte buffer failsjava.lang.ClassNotFoundException - if the type to de-serialize to cannot be found