T - the type of the input to the predicate@FunctionalInterface
public interface CheckedPredicate<T>
| Modifier and Type | Method and Description |
|---|---|
default CheckedPredicate<T> |
negate()
Negates this predicate.
|
static <T> CheckedPredicate<T> |
of(CheckedPredicate<T> methodReference)
Creates a
CheckedPredicate. |
boolean |
test(T t)
Evaluates this predicate on the given argument.
|
default java.util.function.Predicate<T> |
unchecked()
Returns an unchecked
Predicate that will sneaky throw if an exceptions occurs when testing a value. |
static <T> CheckedPredicate<T> of(CheckedPredicate<T> methodReference)
CheckedPredicate.
final CheckedPredicate<Boolean> checkedPredicate = CheckedPredicate.of(Boolean::booleanValue);
final Predicate<Boolean> predicate = checkedPredicate.unchecked();
// = true
predicate.test(Boolean.TRUE);
// throws
predicate.test(null);
T - type of values that are tested by the predicatemethodReference - (typically) a method reference, e.g. Type::methodCheckedPredicateCheckedFunction1.of(CheckedFunction1)boolean test(T t) throws java.lang.Throwable
t - the input argumenttrue if the input argument matches the predicate, otherwise falsejava.lang.Throwable - if an error occursdefault CheckedPredicate<T> negate()
default java.util.function.Predicate<T> unchecked()
Predicate that will sneaky throw if an exceptions occurs when testing a value.Predicate that throws a Throwable.