Interface UnsafePredicate<T>
- Type Parameters:
T
- the type of 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 UnsafePredicate is a
Predicate
which allows exceptions to be thrown.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Predicate<T>
safe(UnsafePredicate<T> pred)
Wraps an unsafe predicate into a safe one.boolean
Same asPredicate.test(Object)
.
-
Method Details
-
safe
Wraps an unsafe predicate into a safe one.- Type Parameters:
T
- the type of the predicate- Parameters:
pred
- the predicate to be wrapped- Returns:
- the safe predicate
-
test
Same asPredicate.test(Object)
.- Parameters:
t
- the value to be tested- Returns:
- true if the predicate is valid
- Throws:
Exception
- could potentially throw any exception
-