public class Predicates extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Predicates.And<T> |
static class |
Predicates.Composite<T> |
static class |
Predicates.FalsePredicate<T>
A predicate that always returns false.
|
static class |
Predicates.Or<T> |
static class |
Predicates.TruePredicate<T>
A predicate that always returns true.
|
Constructor and Description |
---|
Predicates() |
Modifier and Type | Method and Description |
---|---|
static <T> Predicate<T> |
allOf(Predicate<? super T> left,
Predicate<? super T> right)
Create a composite predicate that evaluates to true when both the passed predicates evaluate to true.
|
static <T> Predicate<T> |
anyOf(Predicate<? super T> left,
Predicate<? super T> right)
Create a composite predicate that evaluates to true when one the passed predicates evaluate to true.
|
static <T> Predicate<T> |
equalTo(T check)
A predicate that check that some input equals the passed argument.
|
static <T> Predicate<T> |
falsePredicate()
Return a predicate that always returns false.
|
static <T> Predicate<T> |
isInstanceOf(Class<? extends T> clazz) |
static <T> Predicate<T> |
isNull()
A predicate that check that the input is null.
|
static <T> Predicate<T> |
not(Predicate<? super T> predicate)
Create a predicate that inverts the behaviour of the passed predicate.
|
static <T> Predicate<T> |
notNull()
A predicate that check that the input is not null.
|
static <T> Predicate<T> |
truePredicate()
Return a predicate that always returns true.
|
public static <T> Predicate<T> truePredicate()
T
- the type of input the predicate will work for.public static <T> Predicate<T> falsePredicate()
T
- the type of input the predicate will work for.public static <T> Predicate<T> equalTo(@Nonnull T check)
T
- the typecheck
- the element to check equality of, must not be null.public static <T> Predicate<T> notNull()
T
- the typepublic static <T> Predicate<T> isNull()
T
- the typepublic static <T> Predicate<T> allOf(Predicate<? super T> left, Predicate<? super T> right)
left
- the first predicate.right
- the second predicate.public static <T> Predicate<T> anyOf(Predicate<? super T> left, Predicate<? super T> right)
left
- the first predicate.right
- the second predicate.public static <T> Predicate<T> not(Predicate<? super T> predicate)
T
- the type of the input for the predicate.predicate
- the predicate to negate. Cannot be null.Copyright © 2002-2023 Atlassian. All Rights Reserved.