T - @FunctionalInterface public interface Predicate<T>
true or false for a value.
This type serves the same purpose as the JDK's Predicate, but allows throwing checked exceptions.
It contains methods for bridging to and from the JDK type.
| Modifier and Type | Method and Description |
|---|---|
boolean |
apply(T t)
Tests the given value.
|
static <T> Predicate<T> |
from(Predicate<T> predicate)
Creates a predicate from a JDK predicate.
|
default Predicate<T> |
toPredicate()
Creates a JDK
Predicate from this predicate. |
boolean apply(T t) throws Exception
t - the value to “test”true if the predicate applied, otherwise falseException - anydefault Predicate<T> toPredicate()
Predicate from this predicate.
Any exceptions thrown by this action will be unchecked via ExceptionUtils.uncheck(Throwable) and rethrown.