22 lines
1.3 KiB
Java
22 lines
1.3 KiB
Java
/*
|
|
* Copyright (c) 2003,2009 Declarative Engineering LLC.
|
|
* All rights reserved. This program and the accompanying materials
|
|
* are made available under the terms of the Declarative Engineering LLC
|
|
* verson 1 which accompanies this distribution, and is available at
|
|
* http://declarativeengineering.com/legal/DE_Developer_License_v1.txt
|
|
*/
|
|
package com.foundation.clone;
|
|
|
|
import com.foundation.common.MetadataContainer;
|
|
import com.foundation.metadata.CloneContext;
|
|
|
|
public interface ICloneable extends Cloneable {
|
|
public static final MetadataContainer EMPTY_METADATA = new MetadataContainer();
|
|
/**
|
|
* Creates a clone of the implementing object. A clone is usually a shallow copy of the object, but a clone may be a shallow copy of a composite object as well.
|
|
* @param context The optional cloning context which tracks clone creation to prevent duplicate clones to the same object. A context will be created if not supplied.
|
|
* @param metadata The metadata used for the cloning. If none is provided, or if an object is encountered for which there is no metadata, then a best guess will be taken (ie all immutable data and part-of data that is available will be cloned).
|
|
* @return This instance's clone.
|
|
*/
|
|
public Object cloneObject(CloneContext context, MetadataContainer metadata);
|
|
}//ICloneable// |