Class CloneUtil
java.lang.Object
com.inductiveautomation.ignition.common.util.CloneUtil
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
When cloning objects that support extending (Documents and DocumentArrays), setting this flag will prevent the value from being extended. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Object
cloneArray
(Object source) static <T> T
cloneByCopyConstructor
(T value) Clones an object by locating and invoking its copy constructor.static <T extends Serializable>
TcloneBySerialization
(T value) Clones an object through serialization.static <T> T
cloneIfPossible
(T value) Clones a value if necessary.static QualifiedValue
static QualifiedValue
cloneQualifiedValue
(QualifiedValue value, Flags flags)
-
Field Details
-
PREVENT_EXTENSION
public static final int PREVENT_EXTENSIONWhen cloning objects that support extending (Documents and DocumentArrays), setting this flag will prevent the value from being extended.- See Also:
-
-
Constructor Details
-
CloneUtil
public CloneUtil()
-
-
Method Details
-
cloneByCopyConstructor
public static <T> T cloneByCopyConstructor(T value) Clones an object by locating and invoking its copy constructor. -
cloneIfPossible
public static <T> T cloneIfPossible(T value) Clones a value if necessary. If the value is a primitive, returns the original value. If it's an array, makes a deep copy. -
cloneBySerialization
Clones an object through serialization. Warning: currently dangerous to use in Ignition due to the class resolving. Likely need to pass in a new ClassResolver interface and use ModuleObjectInputStream. -
cloneArray
-
cloneQualifiedValue
-
cloneQualifiedValue
-