0
点赞
收藏
分享

微信扫一扫

深度解析 Bing 搜索引擎的排名因素与算法

三千筱夜 2023-10-20 阅读 19

1. ConvertUtils工具类

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;

public class ConvertUtils {
    private static Logger LOGGER = LoggerFactory.getLogger(ConvertUtils.class);

    // 对象转换
    public static <T> T sourceToTarget(Object source, Class<T> target){
        if(source == null){
            return null;
        }
        T targetObject = null;
        try {
            targetObject = target.newInstance();
            BeanUtils.copyProperties(source, targetObject);
        } catch (Exception e) {
            LOGGER.error("convert error ", e);
        }
        return targetObject;
    }

    public static <T> List<T> sourceToTarget(Collection<?> sourceLis
举报

相关推荐

0 条评论