org.jopendocument.util
Class CopyUtils

java.lang.Object
  extended by org.jopendocument.util.CopyUtils

public final class CopyUtils
extends java.lang.Object


Constructor Summary
CopyUtils()
           
 
Method Summary
static
<E> E
copy(E object)
          Copy the passed object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopyUtils

public CopyUtils()
Method Detail

copy

public static final <E> E copy(E object)
Copy the passed object. First tries to clone() it, otherwise tries with a copy constructor.

Type Parameters:
E - the type of object to be copied.
Parameters:
object - the object to be copied, can be null.
Returns:
a copy of object, or null if object was null.
Throws:
java.lang.IllegalStateException - if the object can't be copied.