Package com.google.common.base
Class Equivalence.EquivalentToPredicate<T>
- java.lang.Object
-
- com.google.common.base.Equivalence.EquivalentToPredicate<T>
-
- All Implemented Interfaces:
Predicate<T>,java.io.Serializable,java.util.function.Predicate<T>
- Enclosing class:
- Equivalence<T>
private static final class Equivalence.EquivalentToPredicate<T> extends java.lang.Object implements Predicate<T>, java.io.Serializable
-
-
Field Summary
Fields Modifier and Type Field Description private Equivalence<T>equivalenceprivate static longserialVersionUIDprivate Ttarget
-
Constructor Summary
Constructors Constructor Description EquivalentToPredicate(Equivalence<T> equivalence, T target)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanapply(T input)Returns the result of applying this predicate toinput(Java 8 users, see notes in the class documentation above).booleanequals(java.lang.Object obj)Indicates whether another object is equal to this predicate.inthashCode()java.lang.StringtoString()
-
-
-
Field Detail
-
equivalence
private final Equivalence<T> equivalence
-
target
private final T target
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EquivalentToPredicate
EquivalentToPredicate(Equivalence<T> equivalence, T target)
-
-
Method Detail
-
apply
public boolean apply(T input)
Description copied from interface:PredicateReturns the result of applying this predicate toinput(Java 8 users, see notes in the class documentation above). This method is generally expected, but not absolutely required, to have the following properties:- Its execution does not cause any observable side effects.
- The computation is consistent with equals; that is,
Objects.equal(a, b)implies thatpredicate.apply(a) == predicate.apply(b)).
-
equals
public boolean equals(java.lang.Object obj)
Description copied from interface:PredicateIndicates whether another object is equal to this predicate.Most implementations will have no reason to override the behavior of
Object.equals(java.lang.Object). However, an implementation may also choose to returntruewheneverobjectis aPredicatethat it considers interchangeable with this one. "Interchangeable" typically means thatthis.apply(t) == that.apply(t)for alltof typeT). Note that afalseresult from this method does not imply that the predicates are known not to be interchangeable.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-