Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.ejie.r01f.clone
Class CloneUtils

    java.lang.Object
      com.ejie.r01f.clone.CloneUtils

public class CloneUtils
extends java.lang.Object

Field Summary
`static boolean` | `DEBUG`
`static java.lang.Class[]` | `EMPTY_CLASS_ARRAY`
`static java.lang.Object[]` | `EMPTY_OBJECT_ARRAY`

Constructor Summary
`CloneUtils()`

Method Summary
`static java.lang.Object` | `cloneByReflection(java.lang.Object objectToClone)` Hace un deep cloning utilizando reflection
`static java.lang.Object` | `cloneBySerialization(java.lang.Object objectToClone)` Realiza un clonado "profundo" de un objeto: clonando toda la jerarquía de objetos Para hacer el clonado se hace una serialización y una deserialización El proceso es: Objeto -> [ObjectOutputStream -> ByteArrayOutputStream] -> [ByteArrayInputStream -> ObjectInputStream] -> clon ATENCION!!
`static void` | `main(java.lang.String[] args)` Main Method

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### EMPTY_OBJECT_ARRAY

    public static final java.lang.Object[] EMPTY_OBJECT_ARRAY

### EMPTY_CLASS_ARRAY

    public static final java.lang.Class[] EMPTY_CLASS_ARRAY

### DEBUG

    public static final boolean DEBUG

Constructor Detail

### CloneUtils

    public CloneUtils()

Method Detail

### cloneBySerialization

    public static java.lang.Object cloneBySerialization(java.lang.Object objectToClone)
                                                 throws java.lang.CloneNotSupportedException

  Realiza un clonado "profundo" de un objeto: clonando toda la jerarquía de objetos Para hacer el clonado se hace una serialización y una deserialización El proceso es: Objeto -> [ObjectOutputStream -> ByteArrayOutputStream] -> [ByteArrayInputStream -> ObjectInputStream] -> clon ATENCION!! Es necesario que todos los objetos de la jerarquía sean SERIALIZABLES

  Returns:
    Un clon del objeto
  Throws:
    `java.lang.CloneNotSupportedException`

### cloneByReflection

    public static java.lang.Object cloneByReflection(java.lang.Object objectToClone)

  Hace un deep cloning utilizando reflection

  Returns:
    deep clone del objeto
  Throws:
    `java.lang.RuntimeException` - ante cualquier fallo

### main

    public static void main(java.lang.String[] args)

  Main Method

  Parameters:
    `args` -

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD