org.glite.authz.common.model.util
Class DeepCopy
java.lang.Object
org.glite.authz.common.model.util.DeepCopy
public class DeepCopy
- extends java.lang.Object
Utility for making deep copies (vs. clone()'s shallow copies) of objects.
Objects are first serialized and then deserialized. Copied objects must
implement the Serializable
interface.
Error checking is fairly minimal in this implementation. If an object is
encountered that cannot be serialized (or that references an object that
cannot be serialized) an error is printed to System.err and null is returned.
NOTICE: The performance of this deep copy utility is not optimal,
serializing and deserializing objects is a very time consuming operation.
Method Summary |
static java.lang.Object |
copy(java.lang.Object object)
Returns a copy of the object, or null if the object cannot be serialized. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DeepCopy
public DeepCopy()
copy
public static java.lang.Object copy(java.lang.Object object)
- Returns a copy of the object, or null if the object cannot be serialized.
- Parameters:
object
- to deep copy
- Returns:
- a deep copy of the original object or
null
if an
error occurs.
Copyright © 2008-2012 EMI - European Middleware Initiative. All Rights Reserved.