org.apache.ignite.binary

## Interface BinaryIdMapper

All Known Implementing Classes:
  BinaryInternalIdMapper

    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.

### Method Summary

Methods
`int` `fieldId(int typeId, String fieldName)` Gets ID for provided field.
`int` `typeId(String clsName)` Gets type ID for provided class name.

### Method Detail

#### typeId

    int typeId(String clsName)

Gets type ID for provided class name.

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

Parameters:
  `clsName` - Class name.
Returns:
  Type ID.

#### fieldId

    int fieldId(int typeId,
              String fieldName)

Gets ID for provided field.

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

Parameters:
  `typeId` - Type ID.
  `fieldName` - Field name.
Returns:
  Field ID.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0-b1
Release Date | : December 1 2015