org.apache.ignite.binary

## Class BinaryFieldIdentityResolver

- java.lang.Object
- - org.apache.ignite.binary.BinaryAbstractIdentityResolver
  - - org.apache.ignite.binary.BinaryFieldIdentityResolver

All Implemented Interfaces:
  BinaryIdentityResolver

    public class BinaryFieldIdentityResolver
    extends BinaryAbstractIdentityResolver

Identity resolver implementation which use the list of provided fields to calculate the hash code and to perform equality checks.

Standard polynomial function with multiplier `31` is used to calculate hash code. For example, for three fields `[a, b, c]`it would be `hash = 31 * (31 * a + b) + c`. Order of fields is important.

### Constructor Summary

Constructors
Constructor and Description
`BinaryFieldIdentityResolver()` Default constructor.
`BinaryFieldIdentityResolver(BinaryFieldIdentityResolver other)` Copy constructor.

### Method Summary

Methods
`boolean` `equals0(BinaryObject o1, BinaryObject o2)` Internal equals routine.
`String[]` `getFieldNames()`
`int` `hashCode0(BinaryObject obj)` Internal hash code routine.
`BinaryFieldIdentityResolver` `setFieldNames(String... fieldNames)` Set field names.
`String` `toString()`

### Methods inherited from class org.apache.ignite.binary.BinaryAbstractIdentityResolver

`equals, hashCode`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### BinaryFieldIdentityResolver

    public BinaryFieldIdentityResolver()

Default constructor.

#### BinaryFieldIdentityResolver

    public BinaryFieldIdentityResolver(BinaryFieldIdentityResolver other)

Copy constructor.

Parameters:
  `other` - Other instance.

### Method Detail

#### getFieldNames

    public String[] getFieldNames()

Returns:
  Fields list to hash/compare objects based upon.

#### setFieldNames

    public BinaryFieldIdentityResolver setFieldNames(String... fieldNames)

Set field names.

Parameters:
  `fieldNames` - Field names.
Returns:
  `this` for chaining.

#### hashCode0

    public int hashCode0(BinaryObject obj)

Internal hash code routine.

Specified by:
  `hashCode0` in class `BinaryAbstractIdentityResolver`
Parameters:
  `obj` - Object.
Returns:
  Result.

#### equals0

    public boolean equals0(BinaryObject o1,
                  BinaryObject o2)

Internal equals routine.

Specified by:
  `equals0` in class `BinaryAbstractIdentityResolver`
Parameters:
  `o1` - First object.
  `o2` - Second object.
Returns:
  Result.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2017 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.9.0
Release Date | : March 2 2017