Class ParameterizedEquivalenceStrategy

  • All Implemented Interfaces:

    public class ParameterizedEquivalenceStrategy
    extends Object
    implements EquivalenceStrategy
    Implementation of EquivalenceStrategy that uses a parametrization of built-in equals/hashCode/diff methods. These strategies are still in progress and (most probably) will be changed before 4.0 release. The difference between REAL_VALUE and IGNORE_METADATA is to be established yet. Basically, REAL_VALUE is oriented towards the effective content of the item or value. Contrary to IGNORE_METADATA it ignores element names and reference filters (if OID is present).
    • Field Detail

      • LITERAL

        public static final ParameterizedEquivalenceStrategy LITERAL
        The (almost) highest level of recognition. Useful e.g. for comparing values for the purpose of XML editing. Still, ignores e.g. definitions, parent objects, origin, immutability flag, etc. Corresponds to pre-4.0 flags ignoreMetadata = false, literal = true.

        public static final ParameterizedEquivalenceStrategy NOT_LITERAL
        As LITERAL but ignores XML namespace prefixes. Also fills-in default relation name if not present (when comparing reference values). Currently this is the default for equals/hashCode. Roughly corresponds to pre-4.0 flags ignoreMetadata = false, literal = false.

        public static final ParameterizedEquivalenceStrategy IGNORE_METADATA
        Ignores metadata, typically operational items and values, container IDs, and origin information. However, takes OID-ful reference filters into account. Corresponds to pre-4.0 flags ignoreMetadata = true, literal = false.

        public static final ParameterizedEquivalenceStrategy IGNORE_METADATA_CONSIDER_DIFFERENT_IDS
        Ignores metadata, typically operational items and values and origin information. Container IDs are taken into account only if they directly contradict each other, meaning both values being compared do have them and they are different. Currently this is the default for diff and for delta application. EXPERIMENTAL

        public static final ParameterizedEquivalenceStrategy LITERAL_IGNORE_METADATA
        As IGNORE_METADATA, but takes XML namespace prefixes into account. It is not clear in which situations this should be needed. But we include it here for compatibility reasons. Historically it is used on a few places in midPoint. Corresponds to pre-4.0 flags ignoreMetadata = true, literal = true.
      • REAL_VALUE

        public static final ParameterizedEquivalenceStrategy REAL_VALUE
        Compares the real content if prism structures. Corresponds to "equalsRealValue" method used in pre-4.0. It is to be seen if operational data should be considered in this mode (they are ignored now). So, currently this is the most lax way of determining equivalence.

        public static final ParameterizedEquivalenceStrategy REAL_VALUE_CONSIDER_DIFFERENT_IDS
        As REAL_VALUE but treats values with different non-null IDs as not equivalent. EXPERIMENTAL
    • Constructor Detail

      • ParameterizedEquivalenceStrategy

        public ParameterizedEquivalenceStrategy()
    • Method Detail

      • getDescription

        public String getDescription()
      • isConsideringDefinitions

        public boolean isConsideringDefinitions()
      • isConsideringElementNames

        public boolean isConsideringElementNames()
      • setCompareElementNames

        public void setCompareElementNames​(boolean compareElementNames)
      • isLiteralDomComparison

        public boolean isLiteralDomComparison()
      • setLiteralDomComparison

        public void setLiteralDomComparison​(boolean literalDomComparison)
      • isConsideringContainerIds

        public boolean isConsideringContainerIds()
      • setConsideringContainerIds

        public void setConsideringContainerIds​(boolean consideringContainerIds)
      • isConsideringDifferentContainerIds

        public boolean isConsideringDifferentContainerIds()
      • setConsideringDifferentContainerIds

        public void setConsideringDifferentContainerIds​(boolean consideringDifferentContainerIds)
      • isConsideringOperationalData

        public boolean isConsideringOperationalData()
      • setConsideringOperationalData

        public void setConsideringOperationalData​(boolean consideringOperationalData)
      • isConsideringReferenceFilters

        public boolean isConsideringReferenceFilters()
      • setConsideringReferenceFilters

        public void setConsideringReferenceFilters​(boolean consideringReferenceFilters)
      • isConsideringReferenceOptions

        public boolean isConsideringReferenceOptions()
      • setConsideringReferenceOptions

        public void setConsideringReferenceOptions​(boolean consideringReferenceOptions)
      • isHashRuntimeSchemaItems

        public boolean isHashRuntimeSchemaItems()
      • setHashRuntimeSchemaItems

        public void setHashRuntimeSchemaItems​(boolean hashRuntimeSchemaItems)