Package com.pivovarit.function
Interface ThrowingPredicate<T,E extends java.lang.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.
@FunctionalInterface public interface ThrowingPredicate<T,E extends java.lang.Exception>
Represents a function that accepts one argument and returns a boolean value Function might throw a checked exception instance.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ThrowingPredicate<T,E>
and(ThrowingPredicate<? super T,? extends E> other)
default ThrowingFunction<T,java.lang.Boolean,E>
asFunction()
default ThrowingPredicate<T,E>
negate()
default ThrowingPredicate<T,E>
or(ThrowingPredicate<? super T,? extends E> other)
static <T> java.util.function.Predicate<T>
sneaky(ThrowingPredicate<T,?> predicate)
boolean
test(T t)
default java.util.function.Predicate<T>
uncheck()
static <T> java.util.function.Predicate<T>
unchecked(ThrowingPredicate<T,?> predicate)
default ThrowingPredicate<T,E>
xor(ThrowingPredicate<? super T,? extends E> other)
-
-
-
Method Detail
-
unchecked
static <T> java.util.function.Predicate<T> unchecked(ThrowingPredicate<T,?> predicate)
-
sneaky
static <T> java.util.function.Predicate<T> sneaky(ThrowingPredicate<T,?> predicate)
- Returns:
- Predicate instance that rethrows the checked exception using the Sneaky Throws pattern
-
and
default ThrowingPredicate<T,E> and(ThrowingPredicate<? super T,? extends E> other)
-
or
default ThrowingPredicate<T,E> or(ThrowingPredicate<? super T,? extends E> other)
-
xor
default ThrowingPredicate<T,E> xor(ThrowingPredicate<? super T,? extends E> other)
-
negate
default ThrowingPredicate<T,E> negate()
-
asFunction
default ThrowingFunction<T,java.lang.Boolean,E> asFunction()
- Returns:
- this Predicate instance as a Function instance
-
uncheck
default java.util.function.Predicate<T> uncheck()
- Returns:
- a new Predicate instance which wraps thrown checked exception instance into a RuntimeException
-
-