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:
    Predicate
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default IOPredicate<T> and​(IOPredicate<? super T> other)
      This method is the same as Predicate.and(Predicate), but with a support for IOException.
      static <T> IOPredicate<T> isEqual​(java.lang.Object targetRef)
      This method is the same as Predicate.isEqual(Object), but with a support for IOException.
      default IOPredicate<T> negate()
      This method is the same as Predicate.negate(), but with a support for IOException.
      default IOPredicate<T> or​(IOPredicate<? super T> other)
      This method is the same as Predicate.or(Predicate), but with a support for IOException.
      boolean test​(T t)
      This method is the same as Predicate.test(Object), but with a support for IOException.
    • Method Detail

      • test

        boolean test​(T t)
              throws java.io.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:
        java.io.IOException - if there is an I/O error performing the operation.
      • and

        default IOPredicate<T> and​(@Nonnull
                                   IOPredicate<? super T> other)
                            throws java.io.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:
        java.io.IOException - if there is an I/O error performing the operation.
      • negate

        default IOPredicate<T> negate()
                               throws java.io.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:
        java.io.IOException - if there is an I/O error performing the operation.
      • or

        default IOPredicate<T> or​(@Nonnull
                                  IOPredicate<? super T> other)
                           throws java.io.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:
        java.io.IOException - if there is an I/O error performing the operation.
      • isEqual

        static <T> IOPredicate<T> isEqual​(java.lang.Object targetRef)
                                   throws java.io.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:
        java.io.IOException - if there is an I/O error performing the operation.