Guest User

Untitled

a guest
Jul 23rd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. public class ObjectStructure {
  2.  
  3. public static Object getStructure(Object o, Object ro)
  4. throws NoSuchFieldException,
  5. IllegalArgumentException,
  6. IllegalAccessException,
  7. InstantiationException{
  8.  
  9. Field[] f = o.getClass().getFields();
  10.  
  11. for(int i=0;i<f.length;++i){
  12. ro.getClass().getField(f[i].getName()).set(ro,f[i].get(o));
  13. }
  14.  
  15. return ro;
  16.  
  17. }
Add Comment
Please, Sign In to add comment