1. 对象之间的拷贝
import org.springframework.beans.BeanUtils;
//将s1的内容拷贝到s2中
BeanUtils.copyProperties(s1, s2);
2. list之间的拷贝
//转换两个不同类型的list
List<PackageInfoBO> packageInfoBOList = Lists.transform(packageInfoList, (PackageInfo packageInfo1) -> {
PackageInfoBO packageInfoBO = new PackageInfoBO();
BeanUtils.copyProperties(packageInfo1, packageInfoBO);
return packageInfoBO;
});