List of utility methods to do Object Clone
Object | clone(final Object obj) clone if (obj == null) { return null; if (obj instanceof Cloneable) { Class<?> clazz = obj.getClass(); Method m; try { m = clazz.getMethod("clone", (Class[]) null); ... |
Object | clone(final Object obj) clone if (obj == null) { return null; if (obj instanceof Cloneable) { Class<?> clazz = obj.getClass(); Method m; try { m = clazz.getMethod("clone", (Class[]) null); ... |
void | clone(Class> clazz, Object source, Object dest) clone Field[] declaredFields = clazz.getDeclaredFields(); try { for (Field field : declaredFields) { field.setAccessible(true); if (Modifier.isFinal(field.getModifiers())) { continue; field.set(dest, field.get(source)); ... |
void | clone(Object source, Object dest) clone clone(source.getClass(), source, dest); |