Package org.apache.commons.beanutils2
Class BeanPredicate<T>
java.lang.Object
org.apache.commons.beanutils2.BeanPredicate<T>
- Type Parameters:
- T- the type of the input to the predicate
- All Implemented Interfaces:
- Predicate<T>
 Predicate implementation that applies the given Predicate to the result of calling the given property getter.
 
- 
Constructor SummaryConstructorsConstructorDescriptionBeanPredicate(String propertyName, Predicate<T> predicate) Constructs aBeanPredicatethat applies the givenPredicateto the named property value.
- 
Method SummaryModifier and TypeMethodDescriptionGets thePredicateto be applied to the value of the named property duringtest(Object).Gets the name of the property whose value is to be predicated. in the evaluation.voidsetPredicate(Predicate<T> predicate) Sets thePredicateto be applied to the value of the named property duringtest(Object).voidsetPropertyName(String propertyName) Sets the name of the property whose value is to be predicated.booleanEvaluates the given object by applying thegetPredicate()to a property value named bygetPropertyName().
- 
Constructor Details- 
BeanPredicateConstructs aBeanPredicatethat applies the givenPredicateto the named property value.- Parameters:
- propertyName- the name of the property whose value is to be predicated, not null
- predicate- the- Predicateto be applied, not null
 
 
- 
- 
Method Details- 
getPredicateGets thePredicateto be applied to the value of the named property duringtest(Object).- Returns:
- Predicate, not null
 
- 
getPropertyNameGets the name of the property whose value is to be predicated. in the evaluation.- Returns:
- the property name, not null
 
- 
setPredicateSets thePredicateto be applied to the value of the named property duringtest(Object).- Parameters:
- predicate-- Predicate, not null
 
- 
setPropertyNameSets 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
 
- 
testEvaluates the given object by applying thegetPredicate()to a property value named bygetPropertyName().- Specified by:
- testin interface- Predicate<T>
- Parameters:
- object- The object to test
- Returns:
- the result of the predicate evaluation
- Throws:
- IllegalArgumentException- when the property cannot be evaluated
 
 
-