Interface ThrowablePredicate<T>
-
- Type Parameters:
T- the type of the input to the predicate
- All Superinterfaces:
java.util.function.Predicate<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ThrowablePredicate<T> extends java.util.function.Predicate<T>Represents a predicate (boolean-valued function) of one argument.Permits checked exceptions unlike
PredicateThis is a functional interface whose functional method is
test(Object).
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static <T> ThrowablePredicate<T>isEqual(java.lang.Object targetRef)Returns a predicate that tests if two arguments are equal according toObjects.equals(Object, Object).default booleantest(T t)Evaluates this predicate on the given argument.booleantestUnsafe(T t)Evaluates this predicate on the given argument.
-
-
-
Method Detail
-
testUnsafe
boolean testUnsafe(T t) throws java.lang.Throwable
Evaluates this predicate on the given argument.- Parameters:
t- the input argument- Returns:
trueif the input argument matches the predicate, otherwisefalse- Throws:
java.lang.Throwable- occurred during processing
-
test
default boolean test(T t)
Evaluates this predicate on the given argument.- Specified by:
testin interfacejava.util.function.Predicate<T>- Parameters:
t- the input argument- Returns:
trueif the input argument matches the predicate, otherwisefalse
-
isEqual
static <T> ThrowablePredicate<T> isEqual(java.lang.Object targetRef)
Returns a predicate that tests if two arguments are equal according toObjects.equals(Object, Object).- Type Parameters:
T- the type of arguments to the predicate- Parameters:
targetRef- the object reference with which to compare for equality, which may benull- Returns:
- a predicate that tests if two arguments are equal according to
Objects.equals(Object, Object)
-
-