private void assignTag(Tag t, Tag assigned) { if (t.getClass() != assigned.getClass()) { return; } for (Field f : t.getClass().getDeclaredFields()) { if ((f.getModifiers() & Modifier.FINAL) == Modifier.FINAL) { continue; } if ((f.getModifiers() & Modifier.STATIC) == Modifier.STATIC) { continue; } try { f.set(t, f.get(assigned)); } catch (IllegalArgumentException | IllegalAccessException ex) { logger.log(Level.SEVERE, null, ex); } } }