Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ObjectStructure {
- public static Object getStructure(Object o, Object ro)
- throws NoSuchFieldException,
- IllegalArgumentException,
- IllegalAccessException,
- InstantiationException{
- Field[] f = o.getClass().getFields();
- for(int i=0;i<f.length;++i){
- ro.getClass().getField(f[i].getName()).set(ro,f[i].get(o));
- }
- return ro;
- }
Add Comment
Please, Sign In to add comment