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
Modifier and TypeFieldDescriptionstatic final ParameterizedEquivalenceStrategy
Captures the data.static final ParameterizedEquivalenceStrategy
AsDATA
but allows missing IDs in the data, i.e. missing vs present PCV ID is not considered as a difference.static final ParameterizedEquivalenceStrategy
This is something betweenDATA
andREAL_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 ParameterizedEquivalenceStrategy
Currently the highest level of recognition.static final ParameterizedEquivalenceStrategy
Deprecated.static final ParameterizedEquivalenceStrategy
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).static final ParameterizedEquivalenceStrategy
AsREAL_VALUE
but taking different PCV IDs into account (if both are present).static final ParameterizedEquivalenceStrategy
Same asREAL_VALUE_CONSIDER_DIFFERENT_IDS
but also takes natural keys into account. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
equals
(PrismValue first, PrismValue second) int
int
hashCode
(PrismValue value) default <V extends PrismValue>
Comparator<V>default <V extends PrismValue>
EqualsChecker<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. -
DATA_ALLOWING_MISSING_IDS
AsDATA
but allows missing IDs in the data, i.e. missing vs present PCV ID is not considered as a difference. -
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_IDS
strategy. -
REAL_VALUE_CONSIDER_DIFFERENT_IDS
AsREAL_VALUE
but taking different PCV IDs into account (if both are present). Currently, this is the default for delta application. SeeParameterizedEquivalenceStrategy.FOR_DELTA_ADD_APPLICATION
andParameterizedEquivalenceStrategy.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. -
REAL_VALUE_CONSIDER_DIFFERENT_IDS_NATURAL_KEYS
@Experimental static final ParameterizedEquivalenceStrategy REAL_VALUE_CONSIDER_DIFFERENT_IDS_NATURAL_KEYSSame asREAL_VALUE_CONSIDER_DIFFERENT_IDS
but also takes natural keys into account. However, natural keys can be considered only if there are PCV ids present in first value. This is to avoid item paths with null segments or natural keys being added to item path. This is a bit experimental. -
IGNORE_METADATA
This is something betweenDATA
andREAL_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
-
prismValueEqualsChecker
-