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:
java.io.Serializable,java.util.function.BiPredicate<F,F>
final class FunctionalEquivalence<F,T> extends Equivalence<F> implements java.io.Serializable
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 Modifier and Type Field Description private Function<F,? extends T>functionprivate Equivalence<T>resultEquivalenceprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description FunctionalEquivalence(Function<F,? extends T> function, Equivalence<T> resultEquivalence)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleandoEquivalent(F a, F b)Implemented by the user to determine whetheraandbare considered equivalent, subject to the requirements specified inEquivalence.equivalent(T, T).protected intdoHash(F a)Implemented by the user to return a hash code fort, subject to the requirements specified inEquivalence.hash(T).booleanequals(java.lang.Object obj)inthashCode()java.lang.StringtoString()-
Methods inherited from class com.google.common.base.Equivalence
equals, equivalent, equivalentTo, hash, identity, onResultOf, pairwise, test, wrap
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
resultEquivalence
private final Equivalence<T> resultEquivalence
-
-
Constructor Detail
-
FunctionalEquivalence
FunctionalEquivalence(Function<F,? extends T> function, Equivalence<T> resultEquivalence)
-
-
Method Detail
-
doEquivalent
protected boolean doEquivalent(F a, F b)
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
protected int doHash(F a)
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
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-