Package com.pivovarit.function
Interface ThrowingPredicate<T,E extends Exception>
- Type Parameters:
T- the type of the input to the functionE- the type of the thrown checked exception
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Represents a function that accepts one argument and returns a boolean value
Function might throw a checked exception instance.
- Author:
- Grzegorz Piwowarek
-
Method Summary
Modifier and TypeMethodDescriptiondefault ThrowingPredicate<T, E> and(ThrowingPredicate<? super T, ? extends E> other) default ThrowingFunction<T, Boolean, E> default ThrowingPredicate<T, E> negate()default ThrowingPredicate<T, E> or(ThrowingPredicate<? super T, ? extends E> other) static <T> Predicate<T> sneaky(ThrowingPredicate<T, ?> predicate) booleanuncheck()static <T> Predicate<T> unchecked(ThrowingPredicate<T, ?> predicate) default ThrowingPredicate<T, E> xor(ThrowingPredicate<? super T, ? extends E> other)
-
Method Details
-
test
- Throws:
E
-
unchecked
-
sneaky
- Returns:
- Predicate instance that rethrows the checked exception using the Sneaky Throws pattern
-
and
-
or
-
xor
-
negate
-
asFunction
- Returns:
- this Predicate instance as a Function instance
-
uncheck
- Returns:
- a new Predicate instance which wraps thrown checked exception instance into a RuntimeException
-