Interface ThrowablePredicate<T>

  • Type Parameters:
    T - the type of the input to the predicate
    All Superinterfaces:
    java.util.function.Predicate<T>
    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 ThrowablePredicate<T>
    extends java.util.function.Predicate<T>
    Represents a predicate (boolean-valued function) of one argument.

    Permits checked exceptions unlike Predicate

    This is a functional interface whose functional method is test(Object).

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      static <T> ThrowablePredicate<T> isEqual​(java.lang.Object targetRef)
      Returns a predicate that tests if two arguments are equal according to Objects.equals(Object, Object).
      default boolean test​(T t)
      Evaluates this predicate on the given argument.
      boolean testUnsafe​(T t)
      Evaluates this predicate on the given argument.
      • Methods inherited from interface java.util.function.Predicate

        and, negate, or
    • Method Detail

      • testUnsafe

        boolean testUnsafe​(T t)
                    throws java.lang.Throwable
        Evaluates this predicate on the given argument.
        Parameters:
        t - the input argument
        Returns:
        true if the input argument matches the predicate, otherwise false
        Throws:
        java.lang.Throwable - occurred during processing
      • test

        default boolean test​(T t)
        Evaluates this predicate on the given argument.
        Specified by:
        test in interface java.util.function.Predicate<T>
        Parameters:
        t - the input argument
        Returns:
        true if the input argument matches the predicate, otherwise false
      • isEqual

        static <T> ThrowablePredicate<T> isEqual​(java.lang.Object targetRef)
        Returns a predicate that tests if two arguments are equal according to Objects.equals(Object, Object).
        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)