org.apache.commons.collections.Predicate |
Known Indirect Subclasses
AllPredicate,
AndPredicate,
AnyPredicate,
EqualPredicate,
ExceptionPredicate,
FalsePredicate,
IdentityPredicate,
InstanceofPredicate,
NonePredicate,
NotNullPredicate,
NotPredicate,
NullIsExceptionPredicate,
NullIsFalsePredicate,
NullIsTruePredicate,
NullPredicate,
and
7 others.
AllPredicate |
Predicate implementation that returns true if all the
predicates return true. |
AndPredicate |
Predicate implementation that returns true if both the predicates return true. |
AnyPredicate |
Predicate implementation that returns true if any of the
predicates return true. |
EqualPredicate |
Predicate implementation that returns true if the input is the same object
as the one stored in this predicate by equals. |
ExceptionPredicate |
Predicate implementation that always throws an exception. |
FalsePredicate |
Predicate implementation that always returns false. |
IdentityPredicate |
Predicate implementation that returns true if the input is the same object
as the one stored in this predicate. |
InstanceofPredicate |
Predicate implementation that returns true if the input is an instanceof
the type stored in this predicate. |
NonePredicate |
Predicate implementation that returns true if none of the
predicates return true. |
NotNullPredicate |
Predicate implementation that returns true if the input is not null. |
NotPredicate |
Predicate implementation that returns the opposite of the decorated predicate. |
NullIsExceptionPredicate |
Predicate implementation that throws an exception if the input is null. |
NullIsFalsePredicate |
Predicate implementation that returns false if the input is null. |
NullIsTruePredicate |
Predicate implementation that returns true if the input is null. |
NullPredicate |
Predicate implementation that returns true if the input is null. |
OnePredicate |
Predicate implementation that returns true if only one of the
predicates return true. |
OrPredicate |
Predicate implementation that returns true if either of the predicates return true. |
PredicateDecorator |
Defines a predicate that decorates one or more other predicates. |
TransformedPredicate |
Predicate implementation that transforms the given object before invoking
another Predicate . |
TransformerPredicate |
Predicate implementation that returns the result of a transformer. |
TruePredicate |
Predicate implementation that always returns true. |
UniquePredicate |
Predicate implementation that returns true the first time an object is
passed into the predicate. |
|
Class Overview
Defines a functor interface implemented by classes that perform a predicate
test on an object.
A Predicate
is the object equivalent of an if
statement.
It uses the input object to return a true or false value, and is often used in
validation or filtering.
Standard implementations of common predicates are provided by
PredicateUtils
. These include true, false, instanceof, equals, and,
or, not, method invokation and null testing.
Summary
Public Methods |
abstract
boolean
|
evaluate(Object object)
Use the specified parameter to perform a test that returns true or false.
|
Public Methods
public
abstract
boolean
evaluate
(Object object)
Use the specified parameter to perform a test that returns true or false.
Parameters
object
| the object to evaluate, should not be changed |