Package uk.megaslice.delta
Interface Essence<T,U>
-
- Type Parameters:
T- the type of dataset itemU- 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 Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Equivalence<T>asEquivalence()Returns anEquivalencefunction derived from this instance, using default equivalence for the distilled items.default Equivalence<T>asEquivalence(Equivalence<U> essenceEquivalence)Returns anEquivalencefunction derived from this instance.Udistill(T value)Return a distilled item for equivalence 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 anEquivalencefunction derived from this instance, using default equivalence for the distilled items.- Returns:
- an
Equivalencefunction derived from this instance
-
asEquivalence
default Equivalence<T> asEquivalence(Equivalence<U> essenceEquivalence)
Returns anEquivalencefunction derived from this instance.- Parameters:
essenceEquivalence- anEquivalencefunction used to compare the distilled items- Returns:
- an
Equivalencefunction derived from this instance
-
-