public class BeanPredicate extends Object implements org.apache.commons.collections.Predicate
Predicate implementation that applies the given Predicate
to the result of calling the given property getter.
| Constructor and Description |
|---|
BeanPredicate(String propertyName,
org.apache.commons.collections.Predicate predicate)
Constructs a
BeanPredicate that applies the given
Predicate to the named property value. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
evaluate(Object object)
Evaluates the given object by applying the
getPredicate()
to a property value named by getPropertyName(). |
org.apache.commons.collections.Predicate |
getPredicate()
Gets the
Predicate to be applied to the value of the named property
during evaluate(java.lang.Object). |
String |
getPropertyName()
Gets the name of the property whose value is to be predicated.
|
void |
setPredicate(org.apache.commons.collections.Predicate predicate)
Sets the
Predicate to be applied to the value of the named property
during evaluate(Object). |
void |
setPropertyName(String propertyName)
Sets the name of the property whose value is to be predicated.
|
public BeanPredicate(String propertyName, org.apache.commons.collections.Predicate predicate)
BeanPredicate that applies the given
Predicate to the named property value.propertyName - the name of the property whose value is to be predicated,
not nullpredicate - the Predicate to be applied,
not nullpublic boolean evaluate(Object object)
getPredicate()
to a property value named by getPropertyName().evaluate in interface org.apache.commons.collections.Predicateobject - The object being evaluatedIllegalArgumentException - when the property cannot be evaluatedpublic org.apache.commons.collections.Predicate getPredicate()
Predicate to be applied to the value of the named property
during evaluate(java.lang.Object).Predicate, not nullpublic String getPropertyName()
public void setPredicate(org.apache.commons.collections.Predicate predicate)
Predicate to be applied to the value of the named property
during evaluate(Object).predicate - Predicate, not nullpublic void setPropertyName(String propertyName)
propertyName - the name of the property whose value is to be predicated,
not nullCopyright © 2000–2025 The Apache Software Foundation. All rights reserved.