|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Predicate<T>
Determines a true or false value for a given input. For example, a
RegexPredicate
might implement Predicate<String>
, and return
true
for any string that matches its given regular expression.
Implementations which may cause side effects upon evaluation are strongly encouraged to state this fact clearly in their API documentation.
Method Summary | |
---|---|
boolean |
apply(T input)
Applies this predicate to the given object. |
boolean |
equals(Object obj)
Indicates whether some other object is equal to this Predicate . |
Method Detail |
---|
boolean apply(@Nullable T input)
input
- the input that the predicate should act on
t
boolean equals(@Nullable Object obj)
Predicate
.
This method can return true
only if the specified object is
also a Predicate
and, for every input object input
, it
returns exactly the same value. Thus, predicate1.equals(predicate2)
implies that either predicate1.apply(input)
and
predicate2.apply(input)
are both true
or both
false
.
Note that it is always safe not to override
Object.equals(java.lang.Object)
.
equals
in class Object
obj
- the reference object with which to compare.
true
if this object is the same as the obj
argument; false
otherwise.Object.hashCode()
,
HashMap
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |