Interface EqualityMatcher<T>

  • Type Parameters:
    T - the type of objects to be compared for equality
    All Known Implementing Classes:
    SimpleTypeComparison, SimpleTypeIdentityComparison

    public interface EqualityMatcher<T>
    Interface representing objects used to perform equality matching. This is used in preference to wrapping the objects in a wrapper with its own equals() and hashCode() methods, to avoid the overhead of wrapper objects in a large data structure
    • Method Detail

      • equal

        boolean equal​(T a,
                      T b)
        Compare two objects for equality
        Parameters:
        a - one object
        b - another object
        Returns:
        true if the two objects are deemed equal
      • hash

        int hash​(T a)
        Compute a hash code for an object
        Parameters:
        a - an object
        Returns:
        a hash code, which has the property that if two objects are equal, then they must have the same hash code