Android Utililty Methods Object Clone

List of utility methods to do Object Clone

Description

The list of methods to do Object Clone are organized into topic(s).

Method

Objectclone(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);
...
Objectclone(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);
...
voidclone(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));
...
voidclone(Object source, Object dest)
clone
clone(source.getClass(), source, dest);