Interface ThrowingPredicate<T,​E extends java.lang.Exception>

  • Type Parameters:
    T - the type of the input to the function
    E - the type of the thrown checked exception
    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 ThrowingPredicate<T,​E extends java.lang.Exception>
    Represents a function that accepts one argument and returns a boolean value Function might throw a checked exception instance.
    • Method Detail

      • test

        boolean test​(T t)
              throws E extends java.lang.Exception
        Throws:
        E extends java.lang.Exception
      • unchecked

        static <T> java.util.function.Predicate<T> unchecked​(ThrowingPredicate<T,​?> predicate)
      • sneaky

        static <T> java.util.function.Predicate<T> sneaky​(ThrowingPredicate<T,​?> predicate)
        Returns:
        Predicate instance that rethrows the checked exception using the Sneaky Throws pattern
      • asFunction

        default ThrowingFunction<T,​java.lang.Boolean,​E> asFunction()
        Returns:
        this Predicate instance as a Function instance
      • uncheck

        default java.util.function.Predicate<T> uncheck()
        Returns:
        a new Predicate instance which wraps thrown checked exception instance into a RuntimeException