public static class Expressive.Predicate extends Object
Provides common implementations of EPredicate.
To promote reusability and reduce code clutter, this class provides implementations of predicates that are commonly used in code.
| Modifier and Type | Method and Description |
|---|---|
static <T> AllOfPredicate<T> |
allOf(EPredicate<T>... predicates)
The returned predicate will return true for
EPredicate.pass(Object) for any value that would pass all
of the given EPredicate instances. |
static <T> EPredicate<T> |
any()
The returned predicate will return true for
EPredicate.pass(Object) for all input. |
static <T> AnyOfPredicate<T> |
anyOf(T... objects)
The returned predicate will return true for
EPredicate.pass(Object) only for objects whose Object.equals(Object) method
returns true for any of the the given arguments. |
static <T> EPredicate<T> |
is(T object)
The returned predicate will return true for
EPredicate.pass(Object) only for objects whose Object.equals(Object) method returns true for the given argument. |
static <T> EPredicate<T> |
isNull()
The returned predicate will return true for
EPredicate.pass(Object) only for null. |
static <T> EPredicate<T> |
none()
The returned predicate will return false for
EPredicate.pass(Object) for all input. |
static <T> EPredicate<T> |
noneOf(T... objects)
The returned predicate will return true for
EPredicate.pass(Object) for any objects whose Object.equals(Object) method
does not return true for any of the the given arguments. |
static <T> EPredicate<T> |
not(EPredicate<T> predicate)
The returned predicate will return the opposite of the given
EPredicate. |
static <T> EPredicate<T> |
not(T value)
The returned predicate will return true for
EPredicate.pass(Object) for any objects whose Object.equals(Object) method
returns false for the given argument. |
static <T> EPredicate<T> |
notNull()
The returned predicate will return true for
EPredicate.pass(Object) for any non-null object. |
static <T> PredicateBuilder<T> |
on(Class<T> type)
Creates a
PredicateBuilder for the specified type. |
public static <T> PredicateBuilder<T> on(Class<T> type)
PredicateBuilder for the specified type.type - the class type to create a predicate forPredicateBuilderpublic static <T> EPredicate<T> any()
EPredicate.pass(Object) for all input.public static <T> EPredicate<T> none()
EPredicate.pass(Object) for all input.public static <T> EPredicate<T> is(T object)
EPredicate.pass(Object) only for objects whose Object.equals(Object) method returns true for the given argument.object - any object, or nullpublic static <T> AnyOfPredicate<T> anyOf(T... objects)
EPredicate.pass(Object) only for objects whose Object.equals(Object) method
returns true for any of the the given arguments.objects - any objects, including nullpublic static <T> EPredicate<T> noneOf(T... objects)
EPredicate.pass(Object) for any objects whose Object.equals(Object) method
does not return true for any of the the given arguments.objects - any objects, including nullpublic static <T> EPredicate<T> isNull()
EPredicate.pass(Object) only for null.public static <T> EPredicate<T> notNull()
EPredicate.pass(Object) for any non-null object.public static <T> EPredicate<T> not(T value)
EPredicate.pass(Object) for any objects whose Object.equals(Object) method
returns false for the given argument.object - any object, or nullpublic static <T> EPredicate<T> not(EPredicate<T> predicate)
EPredicate.predicate - any predicate, must not be nullpublic static <T> AllOfPredicate<T> allOf(EPredicate<T>... predicates)
EPredicate.pass(Object) for any value that would pass all
of the given EPredicate instances.predicates - Copyright © 2013 Atomic Leopard. All Rights Reserved.