Interface ThrowingPredicate2<A,B,T extends Throwable>
- Type Parameters:
A
- The 1st input argument type for the predicateB
- The 2nd input argument type for the predicateT
- The type ofThrowable
thrown by the predicate
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A better version of Java's
BiPredicate
interface that
allows for the predicates to throw whatever Throwable
is specified.- Version:
- 0.1-Alpha-SNAPSHOT
- Author:
- Logan Ferree (Tadukoo)
-
Method Summary
Modifier and TypeMethodDescriptiondefault ThrowingPredicate2<A,
B, T> and
(ThrowingPredicate2<? super A, ? super B, ? extends T> other) Creates a ThrowingPredicate2 that will test the arguments with this ThrowingPredicate2 and with the given ThrowingPredicate2, returning true only if both results are true.default ThrowingPredicate2<A,
B, T> negate()
Creates a ThrowingPredicate2 that will return the opposite result of this ThrowingPredicate2.default ThrowingPredicate2<A,
B, T> or
(ThrowingPredicate2<? super A, ? super B, ? extends T> other) Creates a ThrowingPredicate2 that will test the arguments with this ThrowingPredicate2 and with the given ThrowingPredicate2, returning true if either result is true.boolean
Takes two arguments and returns a boolean.
-
Method Details
-
test
Takes two arguments and returns a boolean.- Parameters:
a
- The 1st argumentb
- The 2nd argument- Returns:
- A boolean
- Throws:
T
- Determined by the predicate, not required
-
and
Creates a ThrowingPredicate2 that will test the arguments with this ThrowingPredicate2 and with the given ThrowingPredicate2, returning true only if both results are true.- Parameters:
other
- The other ThrowingPredicate2 to test the arguments on- Returns:
- The ThrowingPredicate2 that results from composing this one and the given one
-
or
Creates a ThrowingPredicate2 that will test the arguments with this ThrowingPredicate2 and with the given ThrowingPredicate2, returning true if either result is true.- Parameters:
other
- The other ThrowingPredicate2 to test the arguments on- Returns:
- The ThrowingPredicate2 that results from composing this one and the given one
-
negate
Creates a ThrowingPredicate2 that will return the opposite result of this ThrowingPredicate2.- Returns:
- A negated version of this ThrowingPredicate2
-