62,634
社区成员




public <T> T copyAttribute(T t1, T t2) throws IllegalArgumentException, IllegalAccessException {
Class classz = t1.getClass();
Field[] fieldArr = classz.getDeclaredFields();
for(Field f : fieldArr){
Object value = f.get(t2);
if(value != null){
f.set(t1, value);
}
}
return t1;
}