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 in PrismReferenceValues 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 Details

    • LITERAL_MUTABLE

      public static final CloneStrategy LITERAL_MUTABLE
      Literal mutable clone. All properties of the clone are the same as those of the original. The result is mutable.
    • LITERAL

      @Deprecated public static final CloneStrategy LITERAL
      Deprecated.
    • LITERAL_NO_METADATA_MUTABLE

      public static final CloneStrategy LITERAL_NO_METADATA_MUTABLE
      As LITERAL_MUTABLE but ignores the metadata.
    • LITERAL_IGNORING_EMBEDDED_OBJECTS_MUTABLE

      public static final CloneStrategy LITERAL_IGNORING_EMBEDDED_OBJECTS_MUTABLE
      As LITERAL_MUTABLE but ignores the embedded objects.
    • REUSE

      public static final CloneStrategy 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

      public static final CloneStrategy 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, a LITERAL_MUTABLE clone will be done.
  • Constructor Details

    • CloneStrategy

      public CloneStrategy(boolean ignoreMetadata, boolean ignoreContainerValueIds, boolean ignoreEmbeddedObjects, boolean mutableCopy)
      Creates an instance of a CloneStrategy record class.
      Parameters:
      ignoreMetadata - the value for the ignoreMetadata record component
      ignoreContainerValueIds - the value for the ignoreContainerValueIds record component
      ignoreEmbeddedObjects - the value for the ignoreEmbeddedObjects record component
      mutableCopy - the value for the mutableCopy record component
  • Method Details

    • isLiteral

      public boolean isLiteral()
      TODO reconsider this method; replace it with something more specific
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • ignoreMetadata

      public boolean ignoreMetadata()
      Returns the value of the ignoreMetadata record component.
      Returns:
      the value of the ignoreMetadata record component
    • ignoreContainerValueIds

      public boolean ignoreContainerValueIds()
      Returns the value of the ignoreContainerValueIds record component.
      Returns:
      the value of the ignoreContainerValueIds record component
    • ignoreEmbeddedObjects

      public boolean ignoreEmbeddedObjects()
      Returns the value of the ignoreEmbeddedObjects record component.
      Returns:
      the value of the ignoreEmbeddedObjects record component
    • mutableCopy

      public boolean mutableCopy()
      Returns the value of the mutableCopy record component.
      Returns:
      the value of the mutableCopy record component