T
- the generic typepublic class BeanPropertyValueChangeClosure<T> extends Object implements Closure<T>
Closure
实现,用来更新指定属性的指定值.
BeanPropertyValueChangeClosure 构造函数提供两个参数, 属性名称和指定的属性值public BeanPropertyValueChangeClosure(String propertyName, Object propertyValue)注意: Possibly indexed and/or nested name of the property to be modified,参见propertyName.
// create the closure BeanPropertyValueChangeClosure closure = new BeanPropertyValueChangeClosure("activeEmployee", Boolean.TRUE); // update the Collection CollectionUtils.forAllDo(peopleCollection, closure);上面的示例将会提取peopleCollection
的每个 person 对象, 并且更新activeEmployee
属性值为true
.
BeanPropertyValueChangeClosure
,
CollectionUtils.forAllDo(Iterable, Closure)
,
IterableUtils.forEach(Iterable, Closure)
Constructor and Description |
---|
BeanPropertyValueChangeClosure(String propertyName,
Object propertyValue)
Instantiates a new bean property value change closure.
|
public BeanPropertyValueChangeClosure(String propertyName, Object propertyValue)
如果 propertyName
是null,抛出 NullPointerException
如果 propertyName
是blank,抛出 IllegalArgumentException
propertyName
- 指定bean对象排序属性名字.
泛型T对象指定的属性名称,Possibly indexed and/or nested name of the property to be modified,参见 propertyName
propertyValue
- the valueCopyright © 2008-2019 by feilong