Constructor and Description |
---|
PredicateUtil() |
Modifier and Type | Method and Description |
---|---|
static <T> Predicate<T> |
alwaysTrue()
创建一个匹配任何方法的方法匹配器
|
static <T> Predicate<T> |
and(Iterable<Predicate<T>> components)
多个条件转换为”与“复合条件,即所有条件都为true时,才返回true
|
static <T> Predicate<T> |
and(Predicate<T>... components)
多个条件转换为”与“复合条件,即所有条件都为true时,才返回true
|
static <T> Predicate<T> |
negate(Predicate<T> predicate)
反向条件
|
static <T> Predicate<T> |
none(Predicate<T>... components)
用于组合多个方法匹配器的方法匹配器,即所有条件都为false时,才返回true,也可理解为,任一条件为true时,返回false
|
static <T> Predicate<T> |
or(Iterable<Predicate<T>> components)
多个条件转换为”或“复合条件,即任意一个条件都为true时,返回true
|
static <T> Predicate<T> |
or(Predicate<T>... components)
多个条件转换为”或“复合条件,即任意一个条件都为true时,返回true
|
public static <T> Predicate<T> alwaysTrue()
创建一个匹配任何方法的方法匹配器
T
- 参数类型public static <T> Predicate<T> negate(Predicate<T> predicate)
T
- 参数类型predicate
- 条件Predicate
public static <T> Predicate<T> and(Iterable<Predicate<T>> components)
T
- 判断条件的对象类型components
- 多个条件@SafeVarargs public static <T> Predicate<T> and(Predicate<T>... components)
T
- 判断条件的对象类型components
- 多个条件public static <T> Predicate<T> or(Iterable<Predicate<T>> components)
T
- 判断条件的对象类型components
- 多个条件@SafeVarargs public static <T> Predicate<T> or(Predicate<T>... components)
T
- 判断条件的对象类型components
- 多个条件@SafeVarargs public static <T> Predicate<T> none(Predicate<T>... components)
T
- 判断条件的对象类型components
- 多个条件Copyright © 2025. All rights reserved.