import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ClassUtils;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.List;
/**
* Bean属性拷贝工具
*
* @author 向振华
* @date 2021/08/11 14:22
*/
@Slf4j
public class BeanUtils {
public static void copyProperties(Object source, Object target) {
copyProperties(source, target, true, (String[]) null);
}
public static void copyProperties(Object source, Object target, String... ignoreProperties) {
copyProperties(source, target, true, ignoreProperties);
}
public static void copyProperties(Object source, Object target, boolean ignoreNullValue, String... ignoreProperties) {
if (source == null || target == null) {
log.error("Source or Target must not be null");
return;
}
Class<?> actualEditable = target.getClass();
BeanUtils.copyProperties忽略异常、忽略空值,集合复制
最新推荐文章于 2025-12-04 11:14:42 发布


1146

被折叠的 条评论
为什么被折叠?



