T -谓词的输入类型
@FunctionalInterface public interface Predicate<T>
这是一个functional interface其功能的方法是test(Object)。
| Modifier and Type | Method and Description |
|---|---|
default Predicate<T> |
and(Predicate<? super T> other)
返回一个由谓词表示短路逻辑和谓词和另一个。
|
static <T> Predicate<T> |
isEqual(Object targetRef)
返回测试谓词如果按照
Objects.equals(Object, Object)两个参数都是平等的。
|
default Predicate<T> |
negate()
返回一个表示该谓词的逻辑否定的谓词。
|
default Predicate<T> |
or(Predicate<? super T> other)
返回一个由谓词表示短路逻辑或该谓词和另一个。
|
boolean |
test(T t)
在给定的参数上计算这个谓词。
|
boolean test(T t)
t -输入参数
true如果输入参数匹配的谓词,否则
false
default Predicate<T> and(Predicate<? super T> other)
false,然后
other谓词不评价。
抛出的任何异常或谓词评估过程中传递给调用者;如果该谓词评价抛出一个异常,这other谓词将不进行评估。
other -谓语,将逻辑AND这个谓词
other
NullPointerException -如果其他是空的
default Predicate<T> or(Predicate<? super T> other)
true,然后
other谓词不评价。
抛出的任何异常或谓词评估过程中传递给调用者;如果该谓词评价抛出一个异常,这other谓词将不进行评估。
other -谓语,将逻辑或与该谓词
other
NullPointerException -如果其他是空的
static <T> Predicate<T> isEqual(Object targetRef)
Objects.equals(Object, Object)两个参数都是平等的。
T -谓词参数的类型
targetRef -对象引用比较的平等,这可能是
null
Objects.equals(Object, Object)两参数都是平等的
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.