Advertisement
Guest User

Untitled

a guest
May 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.28 KB | None | 0 0
  1.     public void deepcopy(Titel from, Titel to) {
  2.         this._deepcopy(from, to);
  3.     }
  4.  
  5.     public void _deepcopy(Titel from, Titel to) {
  6.         Map<String, String> gehad = new HashMap();
  7.         List<String> setters = Reflection.getMethods(to, "set", "");
  8.         Iterator var5 = setters.iterator();
  9.  
  10.         String name;
  11.         while(var5.hasNext()) {
  12.             String s = (String)var5.next();
  13.             name = s.substring(3);
  14.             if (!gehad.containsKey(name) && Reflection.hasMethod(from, "get" + name)) {
  15.                 Reflection.methodInvoker(to, "set" + name, new Object[]{Reflection.methodInvoker(from, "get" + name, (Object[])null)});
  16.                 gehad.put(name.toLowerCase(), s);
  17.             }
  18.         }
  19.  
  20.         List<Rubriek> rm = this.ttlmdl.getRubrieken(to.getPresoort());
  21.  
  22.         for(int i = 0; i < rm.size(); ++i) {
  23.             name = StringUtils.capitalize(((Rubriek)rm.get(i)).getVeldnaam().trim());
  24.             if (name.length() != 0 && !gehad.containsKey(name.toLowerCase()) && Reflection.hasMethod(from, "get" + name)) {
  25.                 Reflection.methodInvoker(to, "set" + name, new Object[]{Reflection.methodInvoker(from, "get" + name, (Object[])null)});
  26.                 gehad.put(name.toLowerCase(), name);
  27.             }
  28.         }
  29.  
  30.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement