Class ParameterizedEquivalenceStrategy
java.lang.Object
com.evolveum.midpoint.prism.equivalence.ParameterizedEquivalenceStrategy
- All Implemented Interfaces:
EquivalenceStrategy
,Cloneable
public class ParameterizedEquivalenceStrategy
extends Object
implements EquivalenceStrategy, Cloneable
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.
L = literalDomComparison
Compares DOM nodes literally. Currently, this means that the comparison considers namespace prefixes.
Also, (a bit unrelated to DOM): when comparing relations, treats "null" and "org:default" relations as different.
E = consideringElementNames
Takes item names into account. So, for example, "c:user ..." is different from "x:dummy xsi:type=UserType ...".
It looks like a negligible difference that is good to ignore, but beware: this also ensures that
uid=jack attribute is different from name=jack attribute, when comparing attributes as prism properties.
(When comparing them in their containers, element names are treated as different automatically.)
O = consideringOperationalData
Takes operational items into account (when comparing PCVs). Assumes that the definition is set,
otherwise operational status cannot be determined.
Currently, when calling operationalItem1.equals(operationalItem2), the fact that "root" items are operational,
does not play any role. This could change in the future. See TestParseDiffPath.checkComparisonOfOperationalItems.
I = consideringContainerIds
When comparing PCVs we require their IDs are equal. So (e.g.) null vs. null is OK, 123 vs. 123 is OK,
null vs. 123 is not OK, 123 vs. 456 is not OK.
i = consideringDifferentContainerIds
When comparing PCVs we require their IDs are not contradicting. So (e.g.) null vs. 123 is OK, null vs. null is OK,
123 vs. 456 is not OK.
F = consideringReferenceFilters
When comparing references, should we compare also reference filters? (An exception is the case when both OIDs
are null: in that case we always compare the references.)
r = consideringReferenceOptions (resolution time, reference integrity)
When comparing references, should we compare also resolution options, i.e. resolution time and referential integrity?
M = consideringValueMetadata
When comparing prism values, should we take into account value metadata? If yes, we apply the same strategy to them
as was used for data comparison.
n = consideringNaturalKeys
When comparing prism values, should we take into account natural keys?
Summary of individual strategies:
LITERAL L E O I i F r M -
DATA - E O I i F r M -
DATA_ALLOW_MISSING_IDS - E O - i F r M -
IGNORE_METADATA - E - - - F r - -
REAL_VALUE_CONSIDER_DIFFERENT_IDS - - - - i - - - -
REAL_VALUE - - - - - - - - -
REAL_VALUE_CONSIDER_DIFFERENT_IDS_NATURAL_KEYS - - - - i - - - n
Open questions
==============
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 reference filters (if OID is present) and
reference resolution options (resolution time, reference integrity).
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ParameterizedEquivalenceStrategy
static final ParameterizedEquivalenceStrategy
static final ParameterizedEquivalenceStrategy
Fields inherited from interface com.evolveum.midpoint.prism.equivalence.EquivalenceStrategy
DATA, DATA_ALLOWING_MISSING_IDS, IGNORE_METADATA, LITERAL, NOT_LITERAL, REAL_VALUE, REAL_VALUE_CONSIDER_DIFFERENT_IDS, REAL_VALUE_CONSIDER_DIFFERENT_IDS_NATURAL_KEYS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
boolean
equals
(PrismValue first, PrismValue second) boolean
int
hashCode()
int
int
hashCode
(PrismValue value) boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
setConsideringContainerIds
(boolean consideringContainerIds) void
setConsideringDifferentContainerIds
(boolean consideringDifferentContainerIds) void
setConsideringElementNames
(boolean compareElementNames) void
setConsideringNaturalKeys
(boolean consideringNaturalKeys) void
setConsideringOperationalData
(boolean consideringOperationalData) void
setConsideringReferenceFilters
(boolean consideringReferenceFilters) void
setConsideringReferenceOptions
(boolean consideringReferenceOptions) void
setConsideringValueMetadata
(boolean consideringValueMetadata) void
setHashRuntimeSchemaItems
(boolean hashRuntimeSchemaItems) void
setLiteralDomComparison
(boolean literalDomComparison) toString()
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.evolveum.midpoint.prism.equivalence.EquivalenceStrategy
prismValueComparator, prismValueEqualsChecker
-
Field Details
-
DEFAULT_FOR_EQUALS
-
FOR_DELTA_ADD_APPLICATION
-
FOR_DELTA_DELETE_APPLICATION
-
-
Constructor Details
-
ParameterizedEquivalenceStrategy
public ParameterizedEquivalenceStrategy()
-
-
Method Details
-
getLiteral
-
getDescription
-
equals
- Specified by:
equals
in interfaceEquivalenceStrategy
-
equals
- Specified by:
equals
in interfaceEquivalenceStrategy
-
hashCode
- Specified by:
hashCode
in interfaceEquivalenceStrategy
-
hashCode
- Specified by:
hashCode
in interfaceEquivalenceStrategy
-
isConsideringDefinitions
public boolean isConsideringDefinitions() -
isConsideringElementNames
public boolean isConsideringElementNames() -
setConsideringElementNames
public void setConsideringElementNames(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) -
isConsideringValueMetadata
public boolean isConsideringValueMetadata() -
setConsideringValueMetadata
public void setConsideringValueMetadata(boolean consideringValueMetadata) -
isConsideringNaturalKeys
public boolean isConsideringNaturalKeys() -
setConsideringNaturalKeys
public void setConsideringNaturalKeys(boolean consideringNaturalKeys) -
toString
-
clone
-
exceptForValueMetadata
-
equals
-
hashCode
public int hashCode()
-