package com.ssj.weixin.utils;

import org.apache.commons.beanutils.BeanUtils;


import java.util.List;
import java.util.Objects;

public class readingUtil<T> {
    public    void copyList(Object obj, List<T> list2, Class<T> classObj ) {
        if ((!Objects.isNull(obj)) && (!Objects.isNull(list2))) {
            List list1 = (List) obj;
            list1.forEach(item -> {
                try {
                    T data = classObj.newInstance();
                    BeanUtils.copyProperties(data,item );
                    list2.add(data);
                } catch (Exception e) {

                }
            });
        }
    }
}
