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 registered PortableFactory.

Portable serialization that have the following advantages:

  • Support multiversion 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.
See Also:
PortableFactory, PortableWriter, PortableReader, ClassDefinition, DataSerializable, IdentifiedDataSerializable, SerializationConfig
  • Method Summary

    Modifier and Type Method Description
    int getClassId()
    Returns class identifier for this portable class.
    int getFactoryId()
    Returns PortableFactory ID for this portable class
    void readPortable​(PortableReader reader)
    Read portable fields using PortableReader
    void writePortable​(PortableWriter writer)
    Serialize this portable object using PortableWriter
  • Method Details

    • 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 IOException
      Serialize this portable object using PortableWriter
      Parameters:
      writer - PortableWriter
      Throws:
      IOException - in case of any exceptional case
    • readPortable

      void readPortable​(PortableReader reader) throws IOException
      Read portable fields using PortableReader
      Parameters:
      reader - PortableReader
      Throws:
      IOException - in case of any exceptional case