java 拷贝对象

来源:互联网 发布:linux下sleep函数 编辑:程序博客网 时间:2024/05/18 09:06

1:Apache的拷贝

commons-beanutils
commons-beanutils
1.9.2

import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.PropertyUtils;

PropertyUtils.copyProperties(source, target);

BeanUtils.copyProperties(source, target);

2:spring的拷贝(效率高)

org.springframework
spring-beans
4.3.2.RELEASE

import org.springframework.beans.BeanUtils;

BeanUtils.copyProperties(source, target);

1 0
原创粉丝点击