@FunctionalInterface
public interface BooleanPredicate
extends java.util.function.Predicate<java.lang.Boolean>
Predicate
; provides methods to test a primitive type both as object
and as primitive.
Except for the boolean case, this interface extends both a parameterized Predicate
and a type-specific JDK predicate (e.g., IntPredicate
). For types missing
a type-specific JDK predicate (e.g., short
or float
), we extend the predicate associated with
the smallest primitive type that can represent the current type (e.g., int
or double
, respectively).
Predicate
Modifier and Type | Method and Description |
---|---|
default BooleanPredicate |
and(BooleanPredicate other)
Returns a composed type-specific predicate that represents a short-circuiting logical
AND of this type-specific predicate and another.
|
default java.util.function.Predicate<java.lang.Boolean> |
and(java.util.function.Predicate<? super java.lang.Boolean> other)
Deprecated.
Please use the corresponding type-specific method instead.
|
static BooleanPredicate |
identity()
Returns a
BooleanPredicate that returns the boolean to be tested unmodified. |
default BooleanPredicate |
negate() |
static BooleanPredicate |
negation()
Returns a
BooleanPredicate that returns the negation of the boolean to be tested. |
default BooleanPredicate |
or(BooleanPredicate other)
Returns a composed type-specific predicate that represents a short-circuiting logical
OR of this type-specific predicate and another.
|
default java.util.function.Predicate<java.lang.Boolean> |
or(java.util.function.Predicate<? super java.lang.Boolean> other)
Deprecated.
Please use the corresponding type-specific method instead.
|
boolean |
test(boolean t)
Evaluates this predicate on the given input.
|
default boolean |
test(java.lang.Boolean t)
Deprecated.
Please use the corresponding type-specific method instead.
|
boolean test(boolean t)
t
- the input.true
if the input matches the predicate,
otherwise false
static BooleanPredicate identity()
BooleanPredicate
that returns the boolean to be tested unmodified.UnaryOperator.identity()
static BooleanPredicate negation()
BooleanPredicate
that returns the negation of the boolean to be tested.@Deprecated default boolean test(java.lang.Boolean t)
test
in interface java.util.function.Predicate<java.lang.Boolean>
default BooleanPredicate and(BooleanPredicate other)
other
- a predicate that will be logically-ANDed with this predicate.other
predicate.Predicate.and(java.util.function.Predicate<? super T>)
@Deprecated default java.util.function.Predicate<java.lang.Boolean> and(java.util.function.Predicate<? super java.lang.Boolean> other)
and
in interface java.util.function.Predicate<java.lang.Boolean>
default BooleanPredicate negate()
negate
in interface java.util.function.Predicate<java.lang.Boolean>
default BooleanPredicate or(BooleanPredicate other)
other
- a predicate that will be logically-ORed with this predicate.other
predicate.Predicate.or(java.util.function.Predicate<? super T>)
@Deprecated default java.util.function.Predicate<java.lang.Boolean> or(java.util.function.Predicate<? super java.lang.Boolean> other)
or
in interface java.util.function.Predicate<java.lang.Boolean>