Interface ThrowablePredicate<T>

Type Parameters:
T - the type of the input to the predicate
All Superinterfaces:
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 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

    Modifier and Type
    Method
    Description
    static <T> ThrowablePredicate<T>
    isEqual(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
    Evaluates this predicate on the given argument.

    Methods inherited from interface java.util.function.Predicate

    and, negate, or
  • Method Details

    • testUnsafe

      boolean testUnsafe(T t) throws 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:
      Throwable - occurred during processing
    • test

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

      static <T> ThrowablePredicate<T> isEqual(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)