public static
//clone后的集合
List
for(T t:source){
//T temporary=(T) source.getClass().newInstance();
//BeanUtils.copyProperties(temporary,t);//Spring BeanUtils or Apache Commons
T temporary=(T) BeanUtils.cloneBean(t);
temp.add(temporary);
}
return temp;
}
//clone后的集合
List
for(T t:source){
//T temporary=(T) source.getClass().newInstance();
//BeanUtils.copyProperties(temporary,t);//Spring BeanUtils or Apache Commons
T temporary=(T) BeanUtils.cloneBean(t);
temp.add(temporary);
}
return temp;
}
摘自 yhc13429826359的专栏