com.hazelcast.nio.serialization

## Interface Portable

- All Known Subinterfaces:
    VersionedPortable
  All Known Implementing Classes:
    AbstractCredentials, UsernamePasswordCredentials

      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

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and 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 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 IOException

      Serialize this portable object using PortableWriter
      Parameters:
        `writer` - PortableWriter
      Throws:
        `IOException`

    - #### readPortable

          void readPortable(PortableReader reader)
                     throws IOException

      Read portable fields using PortableReader
      Parameters:
        `reader` - PortableReader
      Throws:
        `IOException`

Copyright © 2018. All rights reserved.