com.hazelcast.nio.serialization

## Interface ClassDefinition

-     public interface ClassDefinition

  ClassDefinition defines a class schema for Portable classes. It allows to query field names, types, class ID etc. It can be created manually using `ClassDefinitionBuilder` or on-demand during serialization phase.
  See Also:
    `Portable`, `ClassDefinitionBuilder`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getClassId()` Returns the class ID.
    `int` | `getFactoryId()` Returns the factory ID.
    `FieldDefinition` | `getField(int fieldIndex)` Gets the FieldDefinition for a given fieldIndex.
    `FieldDefinition` | `getField(String name)` Gets the FieldDefinition for a particular field.
    `int` | `getFieldClassId(String fieldName)` Gets the class ID of a field.
    `int` | `getFieldCount()` Returns the field count.
    `Set<String>` | `getFieldNames()` Returns a Set of all field names.
    `FieldType` | `getFieldType(String fieldName)` Get the FieldType for a given fieldName.
    `int` | `getVersion()` Returns the version.
    `boolean` | `hasField(String fieldName)` Checks if there exists a FieldDefinition with the given fieldName.

- - ### Method Detail

    - #### getField

          FieldDefinition getField(String name)

      Gets the FieldDefinition for a particular field.
      Parameters:
        `name` - name of the field
      Returns:
        field definition by given name or null

    - #### getField

          FieldDefinition getField(int fieldIndex)

      Gets the FieldDefinition for a given fieldIndex.
      Parameters:
        `fieldIndex` - index of the field
      Returns:
        field definition by given index
      Throws:
        `IndexOutOfBoundsException` - if the fieldIndex is invalid.

    - #### hasField

          boolean hasField(String fieldName)

      Checks if there exists a FieldDefinition with the given fieldName.
      Parameters:
        `fieldName` - field name
      Returns:
        true if this class definition contains a field named by given name

    - #### getFieldNames

          Set<String> getFieldNames()

      Returns a Set of all field names.
      Returns:
        all field names contained in this class definition

    - #### getFieldType

          FieldType getFieldType(String fieldName)

      Get the FieldType for a given fieldName.
      Parameters:
        `fieldName` - name of the field
      Returns:
        type of given field
      Throws:
        `IllegalArgumentException` - if the field does not exist.

    - #### getFieldClassId

          int getFieldClassId(String fieldName)

      Gets the class ID of a field.
      Parameters:
        `fieldName` - name of the field
      Returns:
        class ID of given field
      Throws:
        `IllegalArgumentException` - if the field does not not exist

    - #### getFieldCount

          int getFieldCount()

      Returns the field count.
      Returns:
        total field count

    - #### getFactoryId

          int getFactoryId()

      Returns the factory ID.
      Returns:
        factory ID

    - #### getClassId

          int getClassId()

      Returns the class ID.
      Returns:
        class ID

    - #### getVersion

          int getVersion()

      Returns the version.
      Returns:
        version

Copyright © 2019. All rights reserved.