Package com.evolveum.midpoint.prism
Record Class CloneStrategy
java.lang.Object
java.lang.Record
com.evolveum.midpoint.prism.CloneStrategy
- Record Components:
ignoreMetadata- Value metadata won't be cloned.ignoreContainerValueIds- Container value IDs won't be cloned.ignoreEmbeddedObjects- Objects embedded inPrismReferenceValues won't be cloned.mutableCopy- Should the copy be always mutable? If false, the copy will be immutable if the original is immutable.
public record CloneStrategy(boolean ignoreMetadata, boolean ignoreContainerValueIds, boolean ignoreEmbeddedObjects, boolean mutableCopy)
extends Record
Describes how cloning (copying) of a prism structure should be done.
- Author:
- semancik
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CloneStrategyDeprecated.static final CloneStrategyLiteral copy, not necessarily mutable.static final CloneStrategyAsLITERAL_MUTABLEbut ignores the embedded objects.static final CloneStrategyLiteral mutable clone.static final CloneStrategyAsLITERAL_MUTABLEbut ignores the metadata.static final CloneStrategyClone for reuse. -
Constructor Summary
ConstructorsConstructorDescriptionCloneStrategy(boolean ignoreMetadata, boolean ignoreContainerValueIds, boolean ignoreEmbeddedObjects, boolean mutableCopy) Creates an instance of aCloneStrategyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theignoreContainerValueIdsrecord component.booleanReturns the value of theignoreEmbeddedObjectsrecord component.booleanReturns the value of theignoreMetadatarecord component.booleanTODO reconsider this method; replace it with something more specificbooleanReturns the value of themutableCopyrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
LITERAL_MUTABLE
Literal mutable clone. All properties of the clone are the same as those of the original. The result is mutable. -
LITERAL
Deprecated. -
LITERAL_NO_METADATA_MUTABLE
AsLITERAL_MUTABLEbut ignores the metadata. -
LITERAL_IGNORING_EMBEDDED_OBJECTS_MUTABLE
AsLITERAL_MUTABLEbut ignores the embedded objects. -
REUSE
Clone for reuse. Create clone of the object that is suitable to be reused in a different object or delta. The cloned object will have the same values, but it will not be presented as the same object as was the source of cloning. E.g. in case of containers it will create a container with the same values but with not identifiers. References will not have full object inside them. The result is mutable. -
LITERAL_ANY
Literal copy, not necessarily mutable. If the original is immutable, then the copy will be immutable as well. However, the copy will have a modifiable parent, so it can be attached to a different prism structure. If the original is mutable, aLITERAL_MUTABLEclone will be done.
-
-
Constructor Details
-
CloneStrategy
public CloneStrategy(boolean ignoreMetadata, boolean ignoreContainerValueIds, boolean ignoreEmbeddedObjects, boolean mutableCopy) Creates an instance of aCloneStrategyrecord class.- Parameters:
ignoreMetadata- the value for theignoreMetadatarecord componentignoreContainerValueIds- the value for theignoreContainerValueIdsrecord componentignoreEmbeddedObjects- the value for theignoreEmbeddedObjectsrecord componentmutableCopy- the value for themutableCopyrecord component
-
-
Method Details
-
isLiteral
public boolean isLiteral()TODO reconsider this method; replace it with something more specific -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='. -
ignoreMetadata
public boolean ignoreMetadata()Returns the value of theignoreMetadatarecord component.- Returns:
- the value of the
ignoreMetadatarecord component
-
ignoreContainerValueIds
public boolean ignoreContainerValueIds()Returns the value of theignoreContainerValueIdsrecord component.- Returns:
- the value of the
ignoreContainerValueIdsrecord component
-
ignoreEmbeddedObjects
public boolean ignoreEmbeddedObjects()Returns the value of theignoreEmbeddedObjectsrecord component.- Returns:
- the value of the
ignoreEmbeddedObjectsrecord component
-
mutableCopy
public boolean mutableCopy()Returns the value of themutableCopyrecord component.- Returns:
- the value of the
mutableCopyrecord component
-