Interface BiPredicate<T,U>

Type Parameters:
T - the first input type
U - the second input type
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 BiPredicate<T,U>
A test of two arguments; the two-argument form of Predicate.
  • Method Summary

    Modifier and Type
    Method
    Description
    default BiPredicate<T,U>
    and(BiPredicate<? super T, ? super U> other)
    Passes when this and other both pass; other is not asked when this fails.
    default BiPredicate<T,U>
    Passes when this fails.
    default BiPredicate<T,U>
    or(BiPredicate<? super T, ? super U> other)
    Passes when this or other passes; other is not asked when this passes.
    boolean
    test(T t, U u)
    Whether t and u pass.
  • Method Details

    • test

      boolean test(T t, U u)
      Whether t and u pass.
      Parameters:
      t - the first input
      u - the second input
      Returns:
      true when they pass
    • and

      default BiPredicate<T,U> and(BiPredicate<? super T, ? super U> other)
      Passes when this and other both pass; other is not asked when this fails.
      Parameters:
      other - the second test
      Returns:
      the composed test
    • negate

      default BiPredicate<T,U> negate()
      Passes when this fails.
      Returns:
      the negated test
    • or

      default BiPredicate<T,U> or(BiPredicate<? super T, ? super U> other)
      Passes when this or other passes; other is not asked when this passes.
      Parameters:
      other - the second test
      Returns:
      the composed test