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 <T> T |
cloneBean(T object)
Clone the given object.
|
static Object |
cloneCloneable(Object object)
Try to clone the given object that implements
Cloneable. |
static Object |
cloneObject(Object object)
Try to clone the given object.
|
public static <T> T clone(T object)
throws NoSuchMethodException,
IllegalAccessException,
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.InvocationTargetException - 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 Object cloneObject(Object object) throws NoSuchMethodException, IllegalAccessException, 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.InvocationTargetException - 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 Object cloneCloneable(Object object) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException
Cloneable.object - The object to clone.NoSuchMethodException - Thrown if a matching method is not found or if the name is "<init>"or
"<clinit>".IllegalAccessException - Thrown if this Method object is enforcing Java language access control
and the underlying method is inaccessible.InvocationTargetException - Thrown if the property accessor method throws an exceptionpublic static <T> T cloneBean(T object)
throws IllegalAccessException,
InstantiationException,
InvocationTargetException,
NoSuchMethodException,
ClassNotFoundException
BeanUtils.cloneBean(Object)T - the generic type of the given beanobject - the object to cloneNoSuchMethodException - Thrown if a matching method is not found or if the name is "<init>"or
"<clinit>".InvocationTargetException - Thrown if the property accessor method throws an exceptionInstantiationException - Thrown if one of the following reasons: the class object
voidIllegalAccessException - Thrown if this Method object is enforcing Java language access control
and the underlying method is inaccessible.ClassNotFoundException - is thrown if the class cannot be locatedCopyright © 2015–2019 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.