ALF-16201: TransformationOptions Should Be More Easily Extended

- Added copyFrom method which does the work of the copying and is called by clone() for cases where deepCopy() can't be called.
   - Added javadocs

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@42454 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ray Gauss
2012-10-08 21:29:09 +00:00
parent 1e2a17611c
commit 40c30b52ce

View File

@@ -111,10 +111,26 @@ public class TransformationOptions implements Cloneable
{
TransformationOptions clone = (TransformationOptions) super.clone();
clone.limits = new TransformationOptionLimits();
clone.set(toMap());
clone.copyFrom(this);
return clone;
}
/**
* Does the work of copying the given other TransformationOptions
* values to this one
*
* @param otherOptions the options to copy
*/
public void copyFrom(TransformationOptions otherOptions)
{
this.set(otherOptions.toMap());
}
/**
* Creates a clone of the TransformationOptions
*
* @return a copy of the options
*/
public TransformationOptions deepCopy()
{
try