Interface ClassDefinition


@Deprecated(since="5.4", forRemoval=true) public interface ClassDefinition
Deprecated, for removal: This API element is subject to removal in a future version.
Portable Serialization has been deprecated. We recommend you use Compact Serialization as Portable Serialization will be removed as of version 7.0.
Defines a class schema for Portable classes. It allows querying of field names, types, class IDs etc. It can be created manually using ClassDefinitionBuilder or on demand during deserialization.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the class ID.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the factory ID.
    getField(int fieldIndex)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the FieldDefinition for a given fieldIndex.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the FieldDefinition for a particular field.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the class ID of a field.
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the field count.
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns a Set of all field names.
    getFieldType(String fieldName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Get the FieldType for a given fieldName.
    default PortableId
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    int
    Deprecated, for removal: This API element is subject to removal in a future version.
    Returns the version.
    boolean
    hasField(String fieldName)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks if there exists a FieldDefinition with the given fieldName.
  • Method Details

    • getField

      FieldDefinition getField(String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns a Set of all field names.
      Returns:
      all field names contained in this class definition
    • getFieldType

      FieldType getFieldType(String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the field count.
      Returns:
      total field count
    • getFactoryId

      int getFactoryId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the factory ID.
      Returns:
      factory ID
    • getClassId

      int getClassId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the class ID.
      Returns:
      class ID
    • getVersion

      int getVersion()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the version.
      Returns:
      version
    • getPortableId

      default PortableId getPortableId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      portable ID of this class
      Since:
      5.4