org.apache.commons.beanutils

Class BeanPredicate

public class BeanPredicate extends Object implements Predicate

Predicate implementation that applies the given Predicate to the result of calling the given property getter.

Constructor Summary
BeanPredicate(String propertyName, Predicate predicate)
Constructs a BeanPredicate that applies the given Predicate to the named property value.
Method Summary
booleanevaluate(Object object)
Evaluates the given object by applying the getPredicate to a property value named by getPropertyName.
PredicategetPredicate()
Gets the Predicate to be applied to the value of the named property during BeanPredicate.
StringgetPropertyName()
Gets the name of the property whose value is to be predicated. in the evaluation.
voidsetPredicate(Predicate predicate)
Sets the Predicate to be applied to the value of the named property during evaluate.
voidsetPropertyName(String propertyName)
Sets the name of the property whose value is to be predicated.

Constructor Detail

BeanPredicate

public BeanPredicate(String propertyName, Predicate predicate)
Constructs a BeanPredicate that applies the given Predicate to the named property value.

Parameters: propertyName the name of the property whose value is to be predicated, not null predicate the Predicate to be applied, not null

Method Detail

evaluate

public boolean evaluate(Object object)
Evaluates the given object by applying the getPredicate to a property value named by getPropertyName.

Parameters: object The object being evaluated

Returns: the result of the predicate evaluation

Throws: IllegalArgumentException when the property cannot be evaluated

getPredicate

public Predicate getPredicate()
Gets the Predicate to be applied to the value of the named property during BeanPredicate.

Returns: Predicate, not null

getPropertyName

public String getPropertyName()
Gets the name of the property whose value is to be predicated. in the evaluation.

Returns: the property name, not null

setPredicate

public void setPredicate(Predicate predicate)
Sets the Predicate to be applied to the value of the named property during evaluate.

Parameters: predicate Predicate, not null

setPropertyName

public void setPropertyName(String propertyName)
Sets the name of the property whose value is to be predicated.

Parameters: propertyName the name of the property whose value is to be predicated, not null

Copyright © 2000-2010 Apache Software Foundation. All Rights Reserved.