PredicateUtils provides reference implementations and utilities
for the Predicate functor interface. The supplied predicates are:
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static < the type that the predicate queries T> Predicate | Returns: theall predicatean array of predicates to check, may not be null predicates)Create a new Predicate that returns true only if all of the specified predicates are true. |
| public static < the type that the predicate queries T> Predicate | Returns: theall predicatea collection of predicates to check, may not be null predicates)Create a new Predicate that returns true only if all of the specified predicates are true. |
| public static < the type that the predicate queries T> Predicate | Returns: theand predicatethe first predicate, may not be null predicate1, final Predicate<? super T> the second predicate, may not be null predicate2)Create a new Predicate that returns true only if both of the specified predicates are true. |
| public static < the type that the predicate queries T> Predicate | Returns: theany predicatean array of predicates to check, may not be null predicates)Create a new Predicate that returns true if any of the specified predicates are true. |
| public static < the type that the predicate queries T> Predicate | Returns: theany predicatea collection of predicates to check, may not be null predicates)Create a new Predicate that returns true if any of the specified predicates are true. |
| public static < the type that the predicate queries T> Predicate | Returns: the transformer wrapping predicatethe transformer to wrap, may not be null transformer)Create a new Predicate that wraps a Transformer. |
| public static < the type that the predicate queries T> Predicate | Returns: theeither predicatethe first predicate, may not be null predicate1, final Predicate<? super T> the second predicate, may not be null predicate2)Create a new Predicate that returns true if one, but not both, of the specified predicates are true. |
| public static < the type that the predicate queries T> Predicate | Returns: the predicatethe value to compare against value)Creates a Predicate that checks if the input object is equal to the specified object using equals(). |
| public static < the type that the predicate queries T> Predicate | |
| public static < the type that the predicate queries T> Predicate | |
| public static < the type that the predicate queries T> Predicate | Returns: the predicatethe value to compare against value)Creates a Predicate that checks if the input object is equal to the specified object by identity. |
| public static Predicate | Returns: the predicatethe type to check for, may not be null type)Creates a Predicate that checks if the object passed in is of a particular type, using instanceof. |
| public static < the type that the predicate queries T> Predicate | Returns: the predicatethe method name to call on the input object, may not be null methodName)Creates a Predicate that invokes a method on the input object. |
| public static < the type that the predicate queries T> Predicate | Returns: the predicatethe method name to call on the input object, may not be null methodName, final Class<?>[] the parameter types paramTypes, final Object[] the arguments args)Creates a Predicate that invokes a method on the input object. |
| public static < the type that the predicate queries T> Predicate | Returns: theneither predicatethe first predicate, may not be null predicate1, final Predicate<? super T> the second predicate, may not be null predicate2)Create a new Predicate that returns true if neither of the specified predicates are true. |
| public static < the type that the predicate queries T> Predicate | Returns: thenone predicatean array of predicates to check, may not be null predicates)Create a new Predicate that returns true if none of the specified predicates are true. |
| public static < the type that the predicate queries T> Predicate | Returns: thenone predicatea collection of predicates to check, may not be null predicates)Create a new Predicate that returns true if none of the specified predicates are true. |
| public static < the type that the predicate queries T> Predicate | Returns: the predicateGets a Predicate that checks if the input object passed in is not null. |
| public static < the type that the predicate queries T> Predicate | Returns: thenot predicatethe predicate to not predicate)Create a new Predicate that returns true if the specified predicate returns false and vice versa. |
| public static < the type that the predicate queries T> Predicate | Returns: the predicatethe predicate to wrap, may not be null predicate)Gets a Predicate that throws an exception if the input object is null, otherwise it calls the specified Predicate. |
| public static < the type that the predicate queries T> Predicate | Returns: the predicatethe predicate to wrap, may not be null predicate)Gets a Predicate that returns false if the input object is null, otherwise it calls the specified Predicate. |
| public static < the type that the predicate queries T> Predicate | Returns: the predicatethe predicate to wrap, may not be null predicate)Gets a Predicate that returns true if the input object is null, otherwise it calls the specified Predicate. |
| public static < the type that the predicate queries T> Predicate | Returns: the predicateGets a Predicate that checks if the input object passed in is null. |
| public static < the type that the predicate queries T> Predicate | Returns: theone predicatean array of predicates to check, may not be null predicates)Create a new Predicate that returns true if only one of the specified predicates are true. |
| public static < the type that the predicate queries T> Predicate | Returns: theone predicatea collection of predicates to check, may not be null predicates)Create a new Predicate that returns true if only one of the specified predicates are true. |
| public static < the type that the predicate queries T> Predicate | Returns: theor predicatethe first predicate, may not be null predicate1, final Predicate<? super T> the second predicate, may not be null predicate2)Create a new Predicate that returns true if either of the specified predicates are true. |
| public static < the type that the predicate queries T> Predicate | Returns: the predicatethe transformer to call first transformer, final Predicate<? super T> the predicate to call with the result of the transform predicate)Creates a predicate that transforms the input object before passing it to the predicate. |
| public static < the type that the predicate queries T> Predicate | |
| public static < the type that the predicate queries T> Predicate | Returns: the predicateCreates a Predicate that returns true the first time an object is encountered, and false if the same object is received again. |
| PredicateUtils | back to summary |
|---|---|
| private PredicateUtils() This class is not normally instantiated. | |
| allPredicate | back to summary |
|---|---|
| public static <T> Predicate Create a new Predicate that returns true only if all of the specified predicates are true. If the array of predicates is empty, then this predicate returns true.
| |
| allPredicate | back to summary |
|---|---|
| public static <T> Predicate Create a new Predicate that returns true only if all of the specified predicates are true. The predicates are checked in iterator order. If the collection of predicates is empty, then this predicate returns true.
| |
| andPredicate | back to summary |
|---|---|
| public static <T> Predicate Create a new Predicate that returns true only if both of the specified predicates are true.
| |
| anyPredicate | back to summary |
|---|---|
| public static <T> Predicate Create a new Predicate that returns true if any of the specified predicates are true. If the array of predicates is empty, then this predicate returns false.
| |
| anyPredicate | back to summary |
|---|---|
| public static <T> Predicate Create a new Predicate that returns true if any of the specified predicates are true. The predicates are checked in iterator order. If the collection of predicates is empty, then this predicate returns false.
| |
| asPredicate | back to summary |
|---|---|
| public static <T> Predicate Create a new Predicate that wraps a Transformer. The Transformer must return either Boolean.TRUE or Boolean.FALSE otherwise a PredicateException will be thrown.
| |
| eitherPredicate | back to summary |
|---|---|
| public static <T> Predicate Create a new Predicate that returns true if one, but not both, of the specified predicates are true. XOR
| |
| equalPredicate | back to summary |
|---|---|
| public static <T> Predicate Creates a Predicate that checks if the input object is equal to the specified object using equals().
| |
| exceptionPredicate | back to summary |
|---|---|
| public static <T> Predicate Gets a Predicate that always throws an exception. This could be useful during testing as a placeholder.
| |
| falsePredicate | back to summary |
|---|---|
| public static <T> Predicate Gets a Predicate that always returns false.
| |
| identityPredicate | back to summary |
|---|---|
| public static <T> Predicate Creates a Predicate that checks if the input object is equal to the specified object by identity.
| |
| instanceofPredicate | back to summary |
|---|---|
| public static Predicate Creates a Predicate that checks if the object passed in is of
a particular type, using instanceof. A
| |
| invokerPredicate | back to summary |
|---|---|
| public static <T> Predicate Creates a Predicate that invokes a method on the input object. The method must return either a boolean or a non-null Boolean, and have no parameters. If the input object is null, a PredicateException is thrown.
For example,
| |
| invokerPredicate | back to summary |
|---|---|
| public static <T> Predicate Creates a Predicate that invokes a method on the input object. The method must return either a boolean or a non-null Boolean, and have no parameters. If the input object is null, a PredicateException is thrown.
For example,
| |
| neitherPredicate | back to summary |
|---|---|
| public static <T> Predicate Create a new Predicate that returns true if neither of the specified predicates are true.
| |
| nonePredicate | back to summary |
|---|---|
| public static <T> Predicate Create a new Predicate that returns true if none of the specified predicates are true. If the array of predicates is empty, then this predicate returns true.
| |
| nonePredicate | back to summary |
|---|---|
| public static <T> Predicate Create a new Predicate that returns true if none of the specified predicates are true. The predicates are checked in iterator order. If the collection of predicates is empty, then this predicate returns true.
| |
| notNullPredicate | back to summary |
|---|---|
| public static <T> Predicate Gets a Predicate that checks if the input object passed in is not null.
| |
| notPredicate | back to summary |
|---|---|
| public static <T> Predicate Create a new Predicate that returns true if the specified predicate returns false and vice versa.
| |
| nullIsExceptionPredicate | back to summary |
|---|---|
| public static <T> Predicate Gets a Predicate that throws an exception if the input object is null, otherwise it calls the specified Predicate. This allows null handling behaviour to be added to Predicates that don't support nulls.
| |
| nullIsFalsePredicate | back to summary |
|---|---|
| public static <T> Predicate Gets a Predicate that returns false if the input object is null, otherwise it calls the specified Predicate. This allows null handling behaviour to be added to Predicates that don't support nulls.
| |
| nullIsTruePredicate | back to summary |
|---|---|
| public static <T> Predicate Gets a Predicate that returns true if the input object is null, otherwise it calls the specified Predicate. This allows null handling behaviour to be added to Predicates that don't support nulls.
| |
| nullPredicate | back to summary |
|---|---|
| public static <T> Predicate Gets a Predicate that checks if the input object passed in is null.
| |
| onePredicate | back to summary |
|---|---|
| public static <T> Predicate Create a new Predicate that returns true if only one of the specified predicates are true. If the array of predicates is empty, then this predicate returns false.
| |
| onePredicate | back to summary |
|---|---|
| public static <T> Predicate Create a new Predicate that returns true if only one of the specified predicates are true. The predicates are checked in iterator order. If the collection of predicates is empty, then this predicate returns false.
| |
| orPredicate | back to summary |
|---|---|
| public static <T> Predicate Create a new Predicate that returns true if either of the specified predicates are true.
| |
| transformedPredicate | back to summary |
|---|---|
| public static <T> Predicate Creates a predicate that transforms the input object before passing it to the predicate.
| |
| truePredicate | back to summary |
|---|---|
| public static <T> Predicate Gets a Predicate that always returns true.
| |
| uniquePredicate | back to summary |
|---|---|
| public static <T> Predicate Creates a Predicate that returns true the first time an object is
encountered, and false if the same object is received
again. The comparison is by equals(). A
| |