final class FunctionalEquivalence<F,T> extends Equivalence<F> implements java.io.Serializable
Equivalence.Equals, Equivalence.Identity, Equivalence.Wrapper<T>| Modifier and Type | Field and Description |
|---|---|
private Function<? super F,? extends T> |
function |
private Equivalence<T> |
resultEquivalence |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
FunctionalEquivalence(Function<? super F,? extends T> function,
Equivalence<T> resultEquivalence) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
doEquivalent(F a,
F b)
Implemented by the user to determine whether
a and b are considered equivalent,
subject to the requirements specified in Equivalence.equivalent(T, T). |
protected int |
doHash(F a)
Implemented by the user to return a hash code for
t, subject to the requirements
specified in Equivalence.hash(T). |
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
java.lang.String |
toString() |
equals, equivalent, equivalentTo, hash, identity, onResultOf, pairwise, test, wrapprivate static final long serialVersionUID
private final Equivalence<T> resultEquivalence
FunctionalEquivalence(Function<? super F,? extends T> function, Equivalence<T> resultEquivalence)
protected boolean doEquivalent(F a, F b)
Equivalencea and b are considered equivalent,
subject to the requirements specified in Equivalence.equivalent(T, T).
This method should not be called except by Equivalence.equivalent(T, T). When Equivalence.equivalent(T, T)
calls this method, a and b are guaranteed to be distinct, non-null instances.
doEquivalent in class Equivalence<F>protected int doHash(F a)
Equivalencet, subject to the requirements
specified in Equivalence.hash(T).
This method should not be called except by Equivalence.hash(T). When Equivalence.hash(T) calls this
method, t is guaranteed to be non-null.
doHash in class Equivalence<F>public boolean equals(@CheckForNull
java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object