Interface Essence<T,​U>

  • Type Parameters:
    T - the type of dataset item
    U - the distilled type for equivalence comparisons
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface Essence<T,​U>
    A function to distill an item down to its essential features for equivalence comparisons. Implementations will typically return a copy of the item with fields defaulted where they are inessential for comparisons.
    • Method Detail

      • distill

        U distill​(T value)
        Return a distilled item for equivalence comparisons.
        Parameters:
        value - the item to distill
        Returns:
        a distilled item for equivalence comparisons
      • asEquivalence

        default Equivalence<T> asEquivalence()
        Returns an Equivalence function derived from this instance, using default equivalence for the distilled items.
        Returns:
        an Equivalence function derived from this instance
      • asEquivalence

        default Equivalence<T> asEquivalence​(Equivalence<U> essenceEquivalence)
        Returns an Equivalence function derived from this instance.
        Parameters:
        essenceEquivalence - an Equivalence function used to compare the distilled items
        Returns:
        an Equivalence function derived from this instance