Interface CompactSerializer<T>
- Type Parameters:
T
- Type of the serialized/deserialized class
public interface CompactSerializer<T>
Defines the contract of the serializers used for Compact serialization.
After defining a serializer for the objects of the class T
, it can be
registered using the
CompactSerializationConfig
.
write(CompactWriter, Object)
and read(CompactReader)
methods must be consistent with each other.
- Since:
- 5.2
-
Method Summary
Modifier and TypeMethodDescriptionReturns the unique type name for the classCompactSerializer
.read
(CompactReader reader) void
write
(CompactWriter writer, T object)
-
Method Details
-
read
- Parameters:
reader
- reader to read fields of an object- Returns:
- the object created as a result of read method
- Throws:
HazelcastSerializationException
- in case of failure to read
-
write
- Parameters:
writer
- CompactWriter to serialize the fields ontoobject
- to be serialized.- Throws:
HazelcastSerializationException
- in case of failure to write
-
getTypeName
Returns the unique type name for the classCompactSerializer
.If the class
CompactSerializer
is ever evolved by adding or removing fields, the type name for the evolved serializers must be the same with the initial version.- Returns:
- the type name
-
getCompactClass
- Returns:
- the class to be serialized with this serializer.
-