Interface ExceptionPredicate<T,E extends Exception>

Type Parameters:
T - the argument type
E - the exception type
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 ExceptionPredicate<T,E extends Exception>
A one-argument predicate which can throw an exception.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a predicate which is true only when this and the given predicate return true.
    not()
    Returns a predicate which is true when this predicate is false, and vice-versa.
    Returns a predicate which is true when either this or the given predicate return true.
    boolean
    test(T t)
    Evaluate this predicate on the given arguments.
    default <U> ExceptionBiPredicate<T,U,E>
    with(ExceptionPredicate<? super U,? extends E> other)
    Returns a bi-predicate which is true when this predicate is true for its first argument, and the given predicate is true for its second argument.
    Returns a predicate which is true when either this or the given predicate (but not both) return true.
  • Method Details

    • test

      boolean test(T t) throws E
      Evaluate this predicate on the given arguments.
      Parameters:
      t - the first argument
      Returns:
      true if the predicate passes, false otherwise
      Throws:
      E - if an exception occurs
    • and

      default ExceptionPredicate<T,E> and(ExceptionPredicate<T,E> other)
      Returns a predicate which is true only when this and the given predicate return true.
      Parameters:
      other - the other predicate (must not be null)
      Returns:
      a predicate which is true only when this and the given predicate return true
    • or

      default ExceptionPredicate<T,E> or(ExceptionPredicate<T,E> other)
      Returns a predicate which is true when either this or the given predicate return true.
      Parameters:
      other - the other predicate (must not be null)
      Returns:
      a predicate which is true when either this or the given predicate return true
    • xor

      default ExceptionPredicate<T,E> xor(ExceptionPredicate<T,E> other)
      Returns a predicate which is true when either this or the given predicate (but not both) return true.
      Parameters:
      other - the other predicate (must not be null)
      Returns:
      a predicate which is true when either this or the given predicate (but not both) return true
    • not

      default ExceptionPredicate<T,E> not()
      Returns a predicate which is true when this predicate is false, and vice-versa.
      Returns:
      a predicate which is true when this predicate is false, and vice-versa
    • with

      default <U> ExceptionBiPredicate<T,U,E> with(ExceptionPredicate<? super U,? extends E> other)
      Returns a bi-predicate which is true when this predicate is true for its first argument, and the given predicate is true for its second argument.
      Type Parameters:
      U - the second argument type
      Parameters:
      other - the other predicate (must not be null)
      Returns:
      a bi-predicate which is true when this predicate is true for its first argument, and the given predicate is true for its second argument