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

阅读 20

2023-10-20

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)

0 0 举报