public final class CloneObjectExtensions extends Object
CloneObjectExtensions provide methods for clone an object.| Constructor and Description |
|---|
CloneObjectExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
clone(T object)
Try to clone the given generic object.
|
static Object |
cloneObject(Object object)
Try to clone the given object.
|
static Object |
cloneObjectQuietly(Object object)
Try to clone the given object quietly.
|
static <T> T |
cloneQuietly(T object)
Try to clone the given generic object.
|
public static <T> T clone(T object)
throws NoSuchMethodException,
IllegalAccessException,
IllegalArgumentException,
InvocationTargetException,
ClassNotFoundException,
InstantiationException,
IOException
T - the generic typeobject - the object to cloneNoSuchMethodException - Thrown if a matching method is not found or if the name is "<init>"or
"<clinit>".SecurityException - Thrown if the security manager indicates a security violation.IllegalAccessException - Thrown if this Method object is enforcing Java language access control
and the underlying method is inaccessible.IllegalArgumentException - Thrown if an illegal argument is givenInvocationTargetException - Thrown if the property accessor method throws an exceptionClassNotFoundException - occurs if a given class cannot be located by the specified class loaderInstantiationException - Thrown if one of the following reasons: the class object
voidIOException - Signals that an I/O exception has occurred.public static <T> T cloneQuietly(T object)
T - the generic typeobject - the object to clonepublic static Object cloneObject(Object object) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, ClassNotFoundException, InstantiationException, IOException
object - The object to clone.NoSuchMethodException - Thrown if a matching method is not found or if the name is "<init>"or
"<clinit>".SecurityException - Thrown if the security manager indicates a security violation.IllegalAccessException - Thrown if this Method object is enforcing Java language access control
and the underlying method is inaccessible.IllegalArgumentException - Thrown if an illegal argument is givenInvocationTargetException - Thrown if the property accessor method throws an exceptionClassNotFoundException - occurs if a given class cannot be located by the specified class loaderInstantiationException - Thrown if one of the following reasons: the class object
voidIOException - Signals that an I/O exception has occurred.Copyright © 2015–2016 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.