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.

@FunctionalInterface public interface UnsafePredicate<T>
A UnsafePredicate is a Predicate which allows exceptions to be thrown.
  • Method Details

    • safe

      static <T> Predicate<T> safe(UnsafePredicate<T> pred)
      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

      boolean test(T t) throws Exception
      Parameters:
      t - the value to be tested
      Returns:
      true if the predicate is valid
      Throws:
      Exception - could potentially throw any exception