mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
add methods
This commit is contained in:
@@ -605,20 +605,6 @@ public class BeanUtil {
|
||||
|
||||
// --------------------------------------------------------------------------------------------- copyProperties
|
||||
|
||||
/**
|
||||
* 创建对应的Class对象并复制Bean对象属性
|
||||
*
|
||||
* @param <T> 对象类型
|
||||
* @param source 源Bean对象
|
||||
* @param tClass 目标Class
|
||||
* @return 目标对象
|
||||
*/
|
||||
public static <T> T copyProperties(Object source, Class<T> tClass) {
|
||||
T target = ReflectUtil.newInstanceIfPossible(tClass);
|
||||
copyProperties(source, target, CopyOptions.create());
|
||||
return target;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按照Bean对象属性创建对应的Class对象,并忽略某些属性
|
||||
*
|
||||
@@ -634,16 +620,6 @@ public class BeanUtil {
|
||||
return target;
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制Bean对象属性
|
||||
*
|
||||
* @param source 源Bean对象
|
||||
* @param target 目标Bean对象
|
||||
*/
|
||||
public static void copyProperties(Object source, Object target) {
|
||||
copyProperties(source, target, CopyOptions.create());
|
||||
}
|
||||
|
||||
/**
|
||||
* 复制Bean对象属性<br>
|
||||
* 限制类用于限制拷贝的属性,例如一个类我只想复制其父类的一些属性,就可以将editable设置为父类
|
||||
|
Reference in New Issue
Block a user