Package org.apache.commons.collections4

# Interface Equator<T>

Type Parameters:
  `T` - The types of object this `Equator` can evaluate.

All Known Implementing Classes:
  `DefaultEquator`

public interface Equator<T>
An equation function, which determines equality between objects of type T.

It is the functional sibling of `Comparator`; `Equator` is to `Object` as `Comparator` is to `Comparable`.

Since:
  4.0

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equate(T o1, T o2)`
  Evaluates the two arguments for their equality.
  `int`
  `hash(T o)`
  Calculates the hash for the object, based on the method of equality used in the equate method.

- ## Method Details

  - ### equate

    boolean equate(T o1, T o2)
    Evaluates the two arguments for their equality.
    Parameters:
      `o1` - The first object to be equated.
      `o2` - The second object to be equated.
    Returns:
      whether the two objects are equal.

  - ### hash

    int hash(T o)
    Calculates the hash for the object, based on the method of equality used in the equate method. This is used for classes that delegate their `equals(Object)` method to an Equator (and so must also delegate their `hashCode()` method), or for implementations of `HashedMap` that use an Equator for the key objects.
    Parameters:
      `o` - The object to calculate the hash for.
    Returns:
      The hash of the object.