Interface IOPredicate<T>

Type Parameters:
T - the type of the input to 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 IOPredicate<T>
Represents a predicate (boolean-valued function) of one argument.

This interface is similar to Predicate except that it is allowed to throw an IOException.

Author:
Magno N A Cruz
See Also:
  • Method Details

    • test

      boolean test(T t) throws IOException

      This method is the same as Predicate.test(Object), but with a support for IOException.

      Parameters:
      t - The input argument.
      Returns:
      true if the input argument matches the predicate, false if not.
      Throws:
      IOException - if there is an I/O error performing the operation.
    • and

      default IOPredicate<T> and(@Nonnull IOPredicate<? super T> other) throws IOException

      This method is the same as Predicate.and(Predicate), but with a support for IOException.

      Parameters:
      other - A predicate that will be logically-ANDed with this predicate.
      Returns:
      A composed predicate that represents the short-circuiting logical AND of this predicate and the other predicate.
      Throws:
      IOException - if there is an I/O error performing the operation.
    • negate

      default IOPredicate<T> negate() throws IOException

      This method is the same as Predicate.negate(), but with a support for IOException.

      Returns:
      A predicate that represents the logical negation of this predicate.
      Throws:
      IOException - if there is an I/O error performing the operation.
    • or

      default IOPredicate<T> or(@Nonnull IOPredicate<? super T> other) throws IOException

      This method is the same as Predicate.or(Predicate), but with a support for IOException.

      Parameters:
      other - A predicate that will be logically-ORed with this predicate.
      Returns:
      A composed predicate that represents the short-circuiting logical OR of this predicate and the other predicate.
      Throws:
      IOException - if there is an I/O error performing the operation.
    • isEqual

      static <T> IOPredicate<T> isEqual(Object targetRef) throws IOException

      This method is the same as Predicate.isEqual(Object), but with a support for IOException.

      Type Parameters:
      T - The type of arguments to the predicate.
      Parameters:
      targetRef - The object reference with which to compare for equality, which may be null.
      Returns:
      A predicate that tests if two arguments are equal according to Objects.equals(Object, Object).
      Throws:
      IOException - if there is an I/O error performing the operation.