Modifier and Type | Method and Description |
---|---|
static <T,O,K extends Collection<T>> |
getPropertyValueCollection(Iterable<O> beanIterable,
String propertyName,
K returnCollection)
循环
beanIterable ,调用 PropertyUtil.getProperty(Object, String) 获得 propertyName的值,塞到 returnCollection
中返回. |
static <T,O> T |
getValue(O obj,
PropertyDescriptor propertyDescriptor)
Gets the value.
|
public static <T,O,K extends Collection<T>> K getPropertyValueCollection(Iterable<O> beanIterable, String propertyName, K returnCollection)
beanIterable
,调用 PropertyUtil.getProperty(Object, String)
获得 propertyName的值,塞到 returnCollection
中返回.T
- the generic typeO
- the generic typeK
- the key typebeanIterable
- 支持
<User>
,Set<User>
等List<Map<String, String>>
List<List<String>>
List<String[]>
propertyName
- 泛型O对象指定的属性名称,Possibly indexed and/or nested name of the property to be modified,参见
propertyNamereturnCollection
- the return collectionreturnCollection
是null,抛出 NullPointerException
beanIterable
是null或者empty,返回 returnCollection
propertyName
是null,抛出 NullPointerException
propertyName
是blank,抛出 IllegalArgumentException
PropertyUtil.getProperty(Object, String)
,
BeanToPropertyValueTransformer
public static <T,O> T getValue(O obj, PropertyDescriptor propertyDescriptor)
T
- the generic typeO
- the generic typeobj
- the objpropertyDescriptor
- the property descriptorobj
是null,抛出 NullPointerException
propertyDescriptor
是null,抛出 NullPointerException
Copyright © 2008-2019 by feilong