package org.sxkj.common.model;
|
|
import org.springblade.core.tool.utils.BeanUtil;
|
|
import java.io.Serializable;
|
|
/**
|
* @Description 通用转换工具类
|
* @Author AIX
|
* @Date 2026/1/12 10:22
|
* @Version 1.0
|
*/
|
public class GenericConverter implements Serializable {
|
|
private static final long serialVersionUID = 1L;
|
|
public static <S, T> T convert(S source, Class<T> targetType) {
|
T target = BeanUtil.newInstance(targetType);
|
BeanUtil.copy(source, target);
|
return target;
|
}
|
|
public static <S, T> T copy(S source, T target) {
|
BeanUtil.copy(source, target);
|
return target;
|
}
|
|
}
|