org.apache.ignite.binary

## Interface BinaryIdMapper

- All Known Implementing Classes:
    BinaryBasicIdMapper

      public interface BinaryIdMapper

  Type and field ID mapper for binary objects. Ignite never writes full strings for field or type names. Instead, for performance reasons, Ignite writes integer hash codes for type and field names. It has been tested that hash code conflicts for the type names or the field names within the same type are virtually non-existent and, to gain performance, it is safe to work with hash codes. For the cases when hash codes for different types or fields actually do collide `BinaryIdMapper` allows to override the automatically generated hash code IDs for the type and field names.

  Binary ID mapper can be configured for all binary objects via `BinaryConfiguration.getIdMapper()` method, or for a specific binary type via `BinaryTypeConfiguration.getIdMapper()` method.

  See Also:
    `BinaryNameMapper`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `fieldId(int typeId, String fieldName)` Gets ID for provided field name.
    `int` | `typeId(String typeName)` Gets type ID for provided type name.

- - ### Method Detail

    - #### typeId

          int typeId(String typeName)

      Gets type ID for provided type name.

      If `0` is returned, hash code of class simple name will be used.

      Parameters:
        `typeName` - Type name. Type name is a result of `BinaryNameMapper.typeName(String)` call for an initial class or type name.
      Returns:
        Type ID.
      See Also:
        `BinaryNameMapper.typeName(String)`

    - #### fieldId

          int fieldId(int typeId,
                      String fieldName)

      Gets ID for provided field name.

      If `0` is returned, hash code of field name will be used.

      Parameters:
        `typeId` - Type ID.
        `fieldName` - Field name. Filed anme is a result of `BinaryNameMapper.fieldName(String)` call for an initial field name.
      Returns:
        Field ID.
      See Also:
        `BinaryNameMapper.fieldName(String)`

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022