public class

BeanPredicate

extends Object
implements Predicate
java.lang.Object
   ↳ org.apache.commons.beanutils.BeanPredicate

Class Overview

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

Summary

Public Constructors
BeanPredicate(String propertyName, Predicate predicate)
Constructs a BeanPredicate that applies the given Predicate to the named property value.
Public Methods
boolean evaluate(Object object)
Evaluates the given object by applying the getPredicate() to a property value named by getPropertyName().
Predicate getPredicate()
Gets the Predicate to be applied to the value of the named property during evaluate(Object).
String getPropertyName()
Gets the name of the property whose value is to be predicated.
void setPredicate(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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.commons.collections.Predicate

Public Constructors

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

Public Methods

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

public Predicate getPredicate ()

Gets the Predicate to be applied to the value of the named property during evaluate(Object).

Returns
  • Predicate, not null

public String getPropertyName ()

Gets the name of the property whose value is to be predicated. in the evaluation.

Returns
  • the property name, not null

public void setPredicate (Predicate predicate)

Sets the Predicate to be applied to the value of the named property during evaluate(Object).

Parameters
predicate Predicate, not null

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