Module bus.core

Interface BiPredicateX<T,U>

Type Parameters:
T - 参数1的类型
U - 参数2的类型
All Superinterfaces:
BiPredicate<T,U>, Serializable
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 BiPredicateX<T,U> extends BiPredicate<T,U>, Serializable
可序列化的BiPredicate接口,支持异常抛出和逻辑组合操作。
Since:
Java 17+
Author:
Kimi Liu
  • Method Summary

    Modifier and Type
    Method
    Description
    default BiPredicateX<T,U>
    and(BiPredicateX<? super T,? super U> other)
    返回一个组合谓词,表示此谓词与另一个谓词的短路逻辑与。
    default BiPredicateX<T,U>
    返回一个表示此谓词逻辑非的谓词。
    default BiPredicateX<T,U>
    or(BiPredicateX<? super T,? super U> other)
    返回一个组合谓词,表示此谓词与另一个谓词的短路逻辑或。
    default boolean
    test(T t, U u)
    对给定的两个参数评估此谓词,自动处理异常。
    boolean
    testing(T t, U u)
    对给定的两个参数评估此谓词,可能抛出异常。

    Methods inherited from interface java.util.function.BiPredicate

    and, or
  • Method Details

    • testing

      boolean testing(T t, U u) throws Throwable
      对给定的两个参数评估此谓词,可能抛出异常。
      Parameters:
      t - 第一个输入参数
      u - 第二个输入参数
      Returns:
      如果参数匹配谓词返回true,否则返回false
      Throws:
      Throwable - 可能抛出的异常
    • test

      default boolean test(T t, U u)
      对给定的两个参数评估此谓词,自动处理异常。
      Specified by:
      test in interface BiPredicate<T,U>
      Parameters:
      t - 第一个输入参数
      u - 第二个输入参数
      Returns:
      如果参数匹配谓词返回true,否则返回false
      Throws:
      RuntimeException - 包装后的运行时异常
    • and

      default BiPredicateX<T,U> and(BiPredicateX<? super T,? super U> other)
      返回一个组合谓词,表示此谓词与另一个谓词的短路逻辑与。如果此谓词为false,则不评估另一个谓词。
      Parameters:
      other - 与此谓词进行逻辑与的谓词
      Returns:
      组合谓词,表示此谓词与other谓词的短路逻辑与
      Throws:
      NullPointerException - 如果other为null
    • negate

      default BiPredicateX<T,U> negate()
      返回一个表示此谓词逻辑非的谓词。
      Specified by:
      negate in interface BiPredicate<T,U>
      Returns:
      表示此谓词逻辑非的谓词
    • or

      default BiPredicateX<T,U> or(BiPredicateX<? super T,? super U> other)
      返回一个组合谓词,表示此谓词与另一个谓词的短路逻辑或。如果此谓词为true,则不评估另一个谓词。
      Parameters:
      other - 与此谓词进行逻辑或的谓词
      Returns:
      组合谓词,表示此谓词与other谓词的短路逻辑或
      Throws:
      NullPointerException - 如果other为null