Package com.hazelcast.nio.serialization
Interface Portable
-
- All Known Subinterfaces:
VersionedPortable
public interface Portable
Portable provides an alternative serialization method. Instead of relying on reflection, each Portable is created by a registeredPortableFactory
.Portable serialization has the following advantages:
- Support multiple versions of the same object type.
(See
SerializationConfig.setPortableVersion(int)
) - Fetching individual fields without having to rely on reflection.
- Querying and indexing support without de-serialization and/or reflection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getClassId()
Returns class identifier for this portable class.int
getFactoryId()
Returns PortableFactory ID for this portable classvoid
readPortable(PortableReader reader)
Read portable fields using PortableReadervoid
writePortable(PortableWriter writer)
Serialize this portable object using PortableWriter
-
-
-
Method Detail
-
getFactoryId
int getFactoryId()
Returns PortableFactory ID for this portable class- Returns:
- factory ID
-
getClassId
int getClassId()
Returns class identifier for this portable class. Class ID should be unique per PortableFactory.- Returns:
- class ID
-
writePortable
void writePortable(PortableWriter writer) throws java.io.IOException
Serialize this portable object using PortableWriter- Parameters:
writer
- PortableWriter- Throws:
java.io.IOException
- in case of any exceptional case
-
readPortable
void readPortable(PortableReader reader) throws java.io.IOException
Read portable fields using PortableReader- Parameters:
reader
- PortableReader- Throws:
java.io.IOException
- in case of any exceptional case
-
-