[b]1、BeanUtils.copyProperties()[/b]
BeanUtils类在org.springframework.beans.BeanUtils和org.apache.commons.beanutils.BeanUtils都存在,但这两个类的copyProperties()方法里面传递的参数赋值是相反的。
例如:a,b为对象,使用BeanUtils.copyProperties(a, b)时作用不一样
[b]2、org.apache.commons.lang3.StringUtils[/b]
参考博客:
-- java之StringUtils 用法
[url]http://blog.csdn.net/thinkingcao/article/details/70239111[/url]
[b]3、org.apache.commons.collections.CollectionUtils[/b]
BeanUtils类在org.springframework.beans.BeanUtils和org.apache.commons.beanutils.BeanUtils都存在,但这两个类的copyProperties()方法里面传递的参数赋值是相反的。
例如:a,b为对象,使用BeanUtils.copyProperties(a, b)时作用不一样
org.springframework.beans.BeanUtils表示:a拷贝到b;
org.apache.commons.beanutils.BeanUtils表示:b拷贝到a;
if(a != null){
BeanUtils.copyProperties(a, bcopya);
bcopya.setPa(true);
bcopya.setPb("888");
}
[b]2、org.apache.commons.lang3.StringUtils[/b]
if (StringUtils.isAnyBlank(pa,pb)) {
return prompt.show("自定义提示语");
}
参考博客:
-- java之StringUtils 用法
[url]http://blog.csdn.net/thinkingcao/article/details/70239111[/url]
[b]3、org.apache.commons.collections.CollectionUtils[/b]
//null或者空
if(CollectionUtils.isNotEmpty(sourceList)){
}