Interface EquivalenceStrategy
- All Known Implementing Classes:
MidpointProvenanceEquivalenceStrategy,ParameterizedEquivalenceStrategy
public interface EquivalenceStrategy
A strategy used to determine equivalence of prism items and values.
This is quite generic interface. We expect that usually it will not be implemented directly, because comparing prism
structures is a complex undertaking. The usual approach will be using ParameterizedEquivalenceStrategy that contains
a set of parameters that drive equals/hashCode methods built into prism structures.
However, if anyone would need the ultimate flexibility, he is free to implement this interface from scratch.
(Note that not all methods in prism API accept this generic form of equivalence strategy. For example, diff(..) methods
are limited to ParameterizedEquivalenceStrategy at least for now.)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParameterizedEquivalenceStrategyCaptures the data.static final ParameterizedEquivalenceStrategyThis is something betweenDATAandREAL_VALUE: ignores operational items and values, container IDs, value metadata (just like REAL_VALUE) but takes reference filters and reference resolution options (time, integrity), as well as item names into account (like DATA).static final ParameterizedEquivalenceStrategyCurrently the highest level of recognition.static final ParameterizedEquivalenceStrategyDeprecated.static final ParameterizedEquivalenceStrategyCaptures the "real value" of the data: it is something that we consider equivalent so that if prism values A and B have the same real value, we do not want to be both present in the same multi-valued item (like assignment, roleMembershipRef, or whatever).static final ParameterizedEquivalenceStrategyAsREAL_VALUEbut taking different PCV IDs into account (if both are present). -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanequals(PrismValue first, PrismValue second) intinthashCode(PrismValue value) default <V extends PrismValue>
Comparator<V>
-
Field Details
-
LITERAL
Currently the highest level of recognition. Roughly corresponds to comparing serialized forms of the data. Useful e.g. for comparing values for the purpose of XML editing. Ignores aspects that are not covered by serialization e.g. definitions, parent objects, origin, immutability flag, etc. -
DATA
Captures the data. Ignores minor serialization-related things that are not relevant for the parsed data, like namespace prefixes. Also ignores the difference between null and default relation. Currently this is the default for equals/hashCode. -
REAL_VALUE
Captures the "real value" of the data: it is something that we consider equivalent so that if prism values A and B have the same real value, we do not want to be both present in the same multi-valued item (like assignment, roleMembershipRef, or whatever). However, in reality, we usually take container IDs (if both are present) into account, so if PCV A1 and A2 have equal content but different IDs they are treated as different. This is reflected inREAL_VALUE_CONSIDER_DIFFERENT_IDSstrategy. -
REAL_VALUE_CONSIDER_DIFFERENT_IDS
AsREAL_VALUEbut taking different PCV IDs into account (if both are present). Currently this is the default for delta application. SeeParameterizedEquivalenceStrategy.FOR_DELTA_ADD_APPLICATIONandParameterizedEquivalenceStrategy.FOR_DELTA_DELETE_APPLICATION. It is not quite clear if this strategy is well-formed. Often we want to differentiate PCV IDs but only on some levels, e.g. for assignments, but not on others, e.g. inside assignments. This has to be sorted out. -
IGNORE_METADATA
This is something betweenDATAandREAL_VALUE: ignores operational items and values, container IDs, value metadata (just like REAL_VALUE) but takes reference filters and reference resolution options (time, integrity), as well as item names into account (like DATA). It is not quite clear whether and when to use this strategy. -
NOT_LITERAL
Deprecated.
-
-
Method Details
-
equals
-
equals
-
hashCode
-
hashCode
-
prismValueComparator
-