BeanUtils

BeanUtils是Spring boot本身就有的.

1、package org.springframework.beans;中的
BeanUtils.copyProperties(A,B);
是A中的值付给B
2、package org.apache.commons.beanutils;(常用)
BeanUtils.copyProperties(A,B);
是B中的值付给A
copyProperties 只有在属性名和参数类型一致的情况下,才可以复制,否则,就要单独set, 并且进行类型转换
原文地址:https://www.cnblogs.com/xinglongbing521/p/10384197.html