T
- the type of argument to test
@FunctionalInterface public interface Predicate<T>
Modifier and Type | Method and Description |
---|---|
default Predicate<T> |
and(Predicate<? super T> p)
Returns a predicate which evaluates to
true only if this
predicate and the provided predicate both evaluate to true . |
static <T> Predicate<T> |
isEqual(Object target)
Returns a predicate who's result matches
Objects.equals(target, t) . |
default Predicate<T> |
negate()
Returns a predicate which negates the result of this predicate.
|
default Predicate<T> |
or(Predicate<? super T> p)
Returns a predicate which evaluates to
true if either this
predicate or the provided predicate evaluates to true . |
boolean |
test(T t)
Returns
true if the input object matches some criteria. |
boolean test(T t)
true
if the input object matches some criteria.t
- the input objecttrue
if the input object matches some criteria, otherwise
false
default Predicate<T> and(Predicate<? super T> p)
true
only if this
predicate and the provided predicate both evaluate to true
. If
this predicate returns false
then the remaining predicate is not
evaluated.
Any exceptions thrown by either test
method are relayed
to the caller; if performing first operation throws an exception, the
second operation will not be performed.
p
- a predicate which will be logically-ANDed with this predicatetrue
only if both
predicates return true
NullPointerException
- if p is nulldefault Predicate<T> negate()
default Predicate<T> or(Predicate<? super T> p)
true
if either this
predicate or the provided predicate evaluates to true
. If this
predicate returns true
then the remaining predicate is not
evaluated.
Any exceptions thrown by either test
method are relayed
to the caller; if performing first operation throws an exception, the
second operation will not be performed.
p
- a predicate which will be logically-ORed with this predicatetrue
if either predicate
returns true
NullPointerException
- if p is nullstatic <T> Predicate<T> isEqual(Object target)
Objects.equals(target, t)
.T
- the type of values evaluated by the predicatetarget
- the target value to be compared for equalityObjects.equals(target, t)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2013, Oracle and/or its affiliates. All rights reserved.
DRAFT internal-0