com.uwyn.rife.continuations.util
Class ObjectUtils
java.lang.Object
com.uwyn.rife.continuations.util.ObjectUtils
public class ObjectUtils
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ObjectUtils
public ObjectUtils()
genericClone
public static Object genericClone(Object object)
- Clone an Object if possible.
This method returns an Object which is a clone of the
input object. It checks if the method implements the
Cloneable interface and then uses reflection to invoke
the clone method.
- Parameters:
object
- The object to be cloned.
- Returns:
null
if the cloning failed; or
the cloned Object
instance.
deepClone
public static Object deepClone(Object object)
throws CloneNotSupportedException
- Try to create a deep clone of the provides object. This handles arrays,
collections and maps. If the class in not a supported standard JDK
collection type the
genericClone
will be used instead.
- Parameters:
object
- The object to be copied.
- Throws:
CloneNotSupportedException
getBaseClass
public static Class getBaseClass(Object object)
- This routine returns the base class of an object. This is just
the class of the object for non-arrays.
- Parameters:
object
- The object whose base class you want to retrieve.