private List parse(List list,Class toClazz){
List resp=Lists.newArrayListWithCapacity(list.size());
resp=(List )list.stream().map(ff->{
Object obj= toClazz.newInstance();
BeanUtils.copyProperties(ff,obj);
return obj;
}).collect(Collectors.toList());
return resp;
}
java 泛型拷贝 List指定Class
最新推荐文章于 2024-08-27 10:32:01 发布