org.glite.authz.common.model.util
Class DeepCopy

java.lang.Object
  extended by 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.


Constructor Summary
DeepCopy()
           
 
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
 

Constructor Detail

DeepCopy

public DeepCopy()
Method Detail

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.