Package com.google.common.base
Class FunctionalEquivalence<F,T>
java.lang.Object
com.google.common.base.Equivalence<F>
com.google.common.base.FunctionalEquivalence<F,T>
- All Implemented Interfaces:
Serializable,BiPredicate<F,F>
Equivalence applied on functional result.
- Since:
- 10.0
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.common.base.Equivalence
Equivalence.Equals, Equivalence.Identity, Equivalence.Wrapper<T> -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFunctionalEquivalence(Function<? super F, ? extends T> function, Equivalence<T> resultEquivalence) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleandoEquivalent(F a, F b) Implemented by the user to determine whetheraandbare considered equivalent, subject to the requirements specified inEquivalence.equivalent(T, T).protected intImplemented by the user to return a hash code fort, subject to the requirements specified inEquivalence.hash(T).booleaninthashCode()toString()Methods inherited from class com.google.common.base.Equivalence
equals, equivalent, equivalentTo, hash, identity, onResultOf, pairwise, test, wrapMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.function.BiPredicate
and, negate, or
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
function
-
resultEquivalence
-
-
Constructor Details
-
FunctionalEquivalence
FunctionalEquivalence(Function<? super F, ? extends T> function, Equivalence<T> resultEquivalence)
-
-
Method Details
-
doEquivalent
Description copied from class:EquivalenceImplemented by the user to determine whetheraandbare considered equivalent, subject to the requirements specified inEquivalence.equivalent(T, T).This method should not be called except by
Equivalence.equivalent(T, T). WhenEquivalence.equivalent(T, T)calls this method,aandbare guaranteed to be distinct, non-null instances.- Specified by:
doEquivalentin classEquivalence<F>
-
doHash
Description copied from class:EquivalenceImplemented by the user to return a hash code fort, subject to the requirements specified inEquivalence.hash(T).This method should not be called except by
Equivalence.hash(T). WhenEquivalence.hash(T)calls this method,tis guaranteed to be non-null.- Specified by:
doHashin classEquivalence<F>
-
equals
-
hashCode
public int hashCode() -
toString
-