Interface ItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
- 
- All Superinterfaces:
- DebugDumpable,- Foreachable<V>,- Freezable,- Itemable,- PathVisitable,- PrismContextSensitive,- Serializable,- Visitable
 - All Known Subinterfaces:
- ContainerDelta<V>,- ItemDeltaDelegator<V,D>,- ProcessedObject.ProcessedObjectItemDelta<V,D>,- PropertyDelta<T>,- ReferenceDelta
 
 public interface ItemDelta<V extends PrismValue,D extends ItemDefinition<?>> extends Itemable, DebugDumpable, Visitable, PathVisitable, Foreachable<V>, Serializable, Freezable, PrismContextSensitive Item Delta describes a change of an item which is a property, container or a reference. It describes only a very small change - a change of a single item. Therefore complex changes can only be described by using several item deltas together.A group of item deltas is called modifications because they describe how an object is modified (they cannot apply to add or delete object delta). Item delta describes values that are being added, removed or replaced with respect to an item. Therefore the item delta may also be of several types: - add of new values. The values in item delta are added to the existing values. Existing values are left as they are.
- delete of existing values. The values in item delta are removed from the set of existing values. Other existing values are left as they are.
- replace of the values. All existing values are removed and all the values in item delta are added.
 
- 
- 
Field Summary- 
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpableINDENT_STRING
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description voidaccept(Visitor visitor)voidaccept(Visitor visitor, boolean includeOldValues)voidaccept(Visitor visitor, ItemPath path, boolean recursive)voidaddEstimatedOldValue(V newValue)voidaddEstimatedOldValues(Collection<V> newValues)voidaddEstimatedOldValues(V... newValues)booleanaddsAnyValue()voidaddToReplaceDelta()voidaddValuesToAdd(Collection<V> newValues)voidaddValuesToAdd(V... newValues)voidaddValuesToDelete(Collection<V> newValues)voidaddValuesToDelete(V... newValues)voidaddValueToAdd(V newValue)voidaddValueToDelete(V newValue)voidaddValueToReplace(V newValue)voidapplyDefinition(D definition)voidapplyDefinition(D itemDefinition, boolean force)voidapplyTo(Item item)voidapplyTo(PrismContainerValue containerValue)voidapplyToMatchingPath(Item item)Applies delta to item.voidassertDefinitions(boolean tolerateRawValues, Supplier<String> sourceDescriptionSupplier)voidassertDefinitions(Supplier<String> sourceDescriptionSupplier)voidcheckConsistence()voidcheckConsistence(boolean requireDefinition, boolean prohibitRaw, ConsistencyCheckScope scope)voidcheckConsistence(ConsistencyCheckScope scope)voidclear()voidclearValuesToAdd()voidclearValuesToDelete()voidclearValuesToReplace()ItemDelta<V,D>clone()ItemDelta<V,D>cloneWithChangedParentPath(ItemPath newParentPath)booleancontains(ItemDelta<V,D> other)Returns true if the other delta is a complete subset of this delta.booleancontains(ItemDelta<V,D> other, EquivalenceStrategy strategy)Returns true if the other delta is a complete subset of this delta.ItemDelta<V,D>createReverseDelta()StringdebugDump(int indent)voiddistributeReplace(Collection<V> existingValues)Distributes the replace values of this delta to add and delete with respect to provided existing values.booleanequals(Object obj)booleanequivalent(ItemDelta other)Deltas are equivalent if they have the same result when applied to an object.voidfilterValues(Function<V,Boolean> function)voidfilterYields(BiFunction<V,PrismContainerValue,Boolean> function)VfindValueToAddOrReplace(V value)voidforeach(Processor<V> processor)Will call processor for every element in the instance.VgetAnyValue()DgetDefinition()ItemNamegetElementName()Collection<V>getEstimatedOldValues()Returns estimated state of the old value before the delta is applied.Class<? extends Item>getItemClass()Item<V,D>getItemNew()Returns the "new" state of the property - the state that would be after the delta is applied.Item<V,D>getItemNew(Item<V,D> itemOld)Returns the "new" state of the property - the state that would be after the delta is applied.Item<V,D>getItemNewMatchingPath(Item<V,D> itemOld)ItemPathgetParentPath()@NotNull ItemPathgetPath()default Collection<?>getRealValuesToAdd()default Collection<?>getRealValuesToDelete()default Collection<?>getRealValuesToReplace()ItemDelta<?,?>getSubDelta(ItemPath path)Collection<V>getValueChanges(PlusMinusZero mode)Collection<V>getValuesToAdd()Collection<V>getValuesToDelete()Collection<V>getValuesToReplace()booleanhasCompleteDefinition()booleanisAdd()booleanisApplicableTo(Item item)booleanisDelete()booleanisEmpty()static booleanisEmpty(ItemDelta<?,?> itemDelta)booleanisImmutable()booleanisLiterallyEmpty()The original semantics ofisEmpty()method: returns true if all of values to add, delete, replace are null.default booleanisOperational()booleanisRaw()booleanisRedundant(PrismObject<? extends Objectable> object, ParameterizedEquivalenceStrategy strategy, boolean assumeMissingItems)Checks if the delta is redundant w.r.t.booleanisReplace()booleanisValueToAdd(V value)booleanisValueToDelete(V value)booleanisValueToReplace(V value)voidmerge(ItemDelta<V,D> deltaToMerge)Merge specified delta to this delta.voidmergeValuesToAdd(Collection<V> newValues)voidmergeValuesToAdd(V[] newValues)voidmergeValuesToDelete(Collection<V> newValues)voidmergeValuesToDelete(V[] newValues)voidmergeValuesToReplace(Collection<V> newValues)voidmergeValuesToReplace(V[] newValues)voidmergeValueToAdd(V newValue)voidmergeValueToDelete(V newValue)voidmergeValueToReplace(V newValue)ItemDelta<V,D>narrow(PrismObject<? extends Objectable> object, @NotNull Comparator<V> plusComparator, @NotNull Comparator<V> minusComparator, boolean assumeMissingItems)Returns the narrowed delta that will have the same effect on the object as the current one.voidnormalize()booleanremoveValueToAdd(PrismValue valueToRemove)booleanremoveValueToDelete(PrismValue valueToRemove)booleanremoveValueToReplace(PrismValue valueToRemove)voidresetValuesToAdd()voidresetValuesToDelete()voidresetValuesToReplace()voidrevive(PrismContext prismContext)voidsetDefinition(D definition)voidsetElementName(QName elementName)voidsetEstimatedOldValues(Collection<V> estimatedOldValues)voidsetOriginTypeRecursive(OriginType originType)Set origin type to all values and subvaluesvoidsetParentPath(ItemPath parentPath)voidsetValuesToReplace(Collection<V> newValues)voidsetValuesToReplace(V... newValues)voidsetValueToReplace()Sets empty value to replace.voidsetValueToReplace(V newValue)voidsimplify()Transforms the delta to the simplest (and safest) form.intsize()PrismValueDeltaSetTriple<V>toDeltaSetTriple(Item<V,D> itemOld)StringtoString()voidvalidate()voidvalidate(String contextDescription)voidvalidateValues(ItemDeltaValidator<V> validator)voidvalidateValues(ItemDeltaValidator<V> validator, Collection<V> oldValues)- 
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpabledebugDump, debugDumpLazily, debugDumpLazily
 - 
Methods inherited from interface com.evolveum.midpoint.prism.FreezablecheckImmutable, checkMutable, freeze
 - 
Methods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitivegetPrismContext
 
- 
 
- 
- 
- 
Method Detail- 
getElementNameItemName getElementName() - Specified by:
- getElementNamein interface- Itemable
 
 - 
setElementNamevoid setElementName(QName elementName) 
 - 
getParentPathItemPath getParentPath() 
 - 
setParentPathvoid setParentPath(ItemPath parentPath) 
 - 
getDefinitionD getDefinition() - Specified by:
- getDefinitionin interface- Itemable
 
 - 
isOperationaldefault boolean isOperational() 
 - 
setDefinitionvoid setDefinition(D definition) 
 - 
acceptvoid accept(Visitor visitor) - Specified by:
- acceptin interface- Visitable<V extends PrismValue>
 
 - 
acceptvoid accept(Visitor visitor, boolean includeOldValues) 
 - 
sizeint size() 
 - 
acceptvoid accept(Visitor visitor, ItemPath path, boolean recursive) - Specified by:
- acceptin interface- PathVisitable
 
 - 
applyDefinitionvoid applyDefinition(D definition) throws SchemaException - Throws:
- SchemaException
 
 - 
hasCompleteDefinitionboolean hasCompleteDefinition() 
 - 
getValuesToAddCollection<V> getValuesToAdd() 
 - 
getRealValuesToAdddefault Collection<?> getRealValuesToAdd() 
 - 
clearValuesToAddvoid clearValuesToAdd() 
 - 
getValuesToDeleteCollection<V> getValuesToDelete() 
 - 
getRealValuesToDeletedefault Collection<?> getRealValuesToDelete() 
 - 
clearValuesToDeletevoid clearValuesToDelete() 
 - 
getValuesToReplaceCollection<V> getValuesToReplace() 
 - 
getRealValuesToReplacedefault Collection<?> getRealValuesToReplace() 
 - 
clearValuesToReplacevoid clearValuesToReplace() 
 - 
addValuesToAddvoid addValuesToAdd(Collection<V> newValues) 
 - 
addValuesToAddvoid addValuesToAdd(V... newValues) 
 - 
addValueToAddvoid addValueToAdd(V newValue) 
 - 
removeValueToAddboolean removeValueToAdd(PrismValue valueToRemove) 
 - 
removeValueToDeleteboolean removeValueToDelete(PrismValue valueToRemove) 
 - 
removeValueToReplaceboolean removeValueToReplace(PrismValue valueToRemove) 
 - 
mergeValuesToAddvoid mergeValuesToAdd(Collection<V> newValues) 
 - 
mergeValuesToAddvoid mergeValuesToAdd(V[] newValues) 
 - 
mergeValueToAddvoid mergeValueToAdd(V newValue) 
 - 
addValuesToDeletevoid addValuesToDelete(Collection<V> newValues) 
 - 
addValuesToDeletevoid addValuesToDelete(V... newValues) 
 - 
addValueToDeletevoid addValueToDelete(V newValue) 
 - 
mergeValuesToDeletevoid mergeValuesToDelete(Collection<V> newValues) 
 - 
mergeValuesToDeletevoid mergeValuesToDelete(V[] newValues) 
 - 
mergeValueToDeletevoid mergeValueToDelete(V newValue) 
 - 
resetValuesToAddvoid resetValuesToAdd() 
 - 
resetValuesToDeletevoid resetValuesToDelete() 
 - 
resetValuesToReplacevoid resetValuesToReplace() 
 - 
setValuesToReplacevoid setValuesToReplace(Collection<V> newValues) 
 - 
setValuesToReplacevoid setValuesToReplace(V... newValues) 
 - 
setValueToReplacevoid setValueToReplace() Sets empty value to replace. This efficiently means removing all values.
 - 
setValueToReplacevoid setValueToReplace(V newValue) 
 - 
addValueToReplacevoid addValueToReplace(V newValue) 
 - 
mergeValuesToReplacevoid mergeValuesToReplace(Collection<V> newValues) 
 - 
mergeValuesToReplacevoid mergeValuesToReplace(V[] newValues) 
 - 
mergeValueToReplacevoid mergeValueToReplace(V newValue) 
 - 
isValueToAddboolean isValueToAdd(V value) 
 - 
isValueToDeleteboolean isValueToDelete(V value) 
 - 
isValueToReplaceboolean isValueToReplace(V value) 
 - 
getAnyValueV getAnyValue() 
 - 
isEmptyboolean isEmpty() 
 - 
isEmptystatic boolean isEmpty(ItemDelta<?,?> itemDelta) 
 - 
isLiterallyEmptyboolean isLiterallyEmpty() The original semantics ofisEmpty()method: returns true if all of values to add, delete, replace are null. TODO is this really needed?
 - 
addsAnyValueboolean addsAnyValue() 
 - 
foreachvoid foreach(Processor<V> processor) Description copied from interface:ForeachableWill call processor for every element in the instance. This is NOT recursive. E.g. in case of collection of collections the processor will NOT be called for elements of the inner collections. If you need recursion please have a look at Visitor.- Specified by:
- foreachin interface- Foreachable<V extends PrismValue>
 
 - 
getEstimatedOldValuesCollection<V> getEstimatedOldValues() Returns estimated state of the old value before the delta is applied. This information is not entirely reliable. The state might change between the value is read and the delta is applied. This is property is optional and even if provided it is only for for informational purposes.If this method returns null then it should be interpreted as "I do not know". In that case the delta has no information about the old values. If this method returns empty collection then it should be interpreted that we know that there were no values in this item before the delta was applied. - Returns:
- estimated state of the old value before the delta is applied (may be null).
 
 - 
setEstimatedOldValuesvoid setEstimatedOldValues(Collection<V> estimatedOldValues) 
 - 
addEstimatedOldValuesvoid addEstimatedOldValues(Collection<V> newValues) 
 - 
addEstimatedOldValuesvoid addEstimatedOldValues(V... newValues) 
 - 
addEstimatedOldValuevoid addEstimatedOldValue(V newValue) 
 - 
normalizevoid normalize() 
 - 
isReplaceboolean isReplace() 
 - 
isAddboolean isAdd() 
 - 
isDeleteboolean isDelete() 
 - 
clearvoid clear() 
 - 
narrowItemDelta<V,D> narrow(PrismObject<? extends Objectable> object, @NotNull @NotNull Comparator<V> plusComparator, @NotNull @NotNull Comparator<V> minusComparator, boolean assumeMissingItems) Returns the narrowed delta that will have the same effect on the object as the current one.We can skip deletion of vDel if there is no vEx ~ vDel (under minusComparator). We can skip addition of vAdd if there is existing vEx ~ vAdd (under plusComparator). But if we do that we must be sure to skip deletion of all vDel ~ vAdd (under minusComparator). Otherwise we would delete vDel but fail to add equivalent vAdd. We can skip replacing of a set of values if and only if existing item has equivalent values under plusComparator. This reasoning is bound to the actual application algorithm in ItemDeltaImpl. But we should be aware that there are deltas that are applied by other code, e.g. those than are applied on a resource. - Parameters:
- plusComparator- Comparator we want to use when determining skippability of values being added.
- minusComparator- Comparator we want to use when determining skippability of values being deleted.
 
 - 
isRedundantboolean isRedundant(PrismObject<? extends Objectable> object, ParameterizedEquivalenceStrategy strategy, boolean assumeMissingItems) Checks if the delta is redundant w.r.t. current state of the object. I.e. if it changes the current object state.- Parameters:
- assumeMissingItems- Assumes that some items in the object may be missing. So delta that replaces them by null
 
 - 
validatevoid validate() throws SchemaException- Throws:
- SchemaException
 
 - 
validatevoid validate(String contextDescription) throws SchemaException - Throws:
- SchemaException
 
 - 
validateValuesvoid validateValues(ItemDeltaValidator<V> validator) throws SchemaException - Throws:
- SchemaException
 
 - 
validateValuesvoid validateValues(ItemDeltaValidator<V> validator, Collection<V> oldValues) throws SchemaException - Throws:
- SchemaException
 
 - 
checkConsistencevoid checkConsistence() 
 - 
checkConsistencevoid checkConsistence(ConsistencyCheckScope scope) 
 - 
checkConsistencevoid checkConsistence(boolean requireDefinition, boolean prohibitRaw, ConsistencyCheckScope scope)
 - 
distributeReplacevoid distributeReplace(Collection<V> existingValues) Distributes the replace values of this delta to add and delete with respect to provided existing values.
 - 
mergevoid merge(ItemDelta<V,D> deltaToMerge) Merge specified delta to this delta. This delta is assumed to be chronologically earlier, delta provided in the parameter is chronologically later.TODO do we expect that the paths of "this" delta and deltaToMerge are the same? From the code it seems so. 
 - 
getValueChangesCollection<V> getValueChanges(PlusMinusZero mode) 
 - 
simplifyvoid simplify() Transforms the delta to the simplest (and safest) form. E.g. it will transform add delta for single-value properties to replace delta.
 - 
applyTovoid applyTo(PrismContainerValue containerValue) throws SchemaException - Throws:
- SchemaException
 
 - 
applyTovoid applyTo(Item item) throws SchemaException - Throws:
- SchemaException
 
 - 
applyToMatchingPathvoid applyToMatchingPath(Item item) throws SchemaException Applies delta to item. Assumes that path of the delta and path of the item matches (does not do path checks).- Throws:
- SchemaException
 
 - 
isApplicableToboolean isApplicableTo(Item item) 
 - 
getItemNewItem<V,D> getItemNew() throws SchemaException Returns the "new" state of the property - the state that would be after the delta is applied.- Throws:
- SchemaException
 
 - 
getItemNewItem<V,D> getItemNew(Item<V,D> itemOld) throws SchemaException Returns the "new" state of the property - the state that would be after the delta is applied.- Throws:
- SchemaException
 
 - 
getItemNewMatchingPathItem<V,D> getItemNewMatchingPath(Item<V,D> itemOld) throws SchemaException - Throws:
- SchemaException
 
 - 
containsboolean contains(ItemDelta<V,D> other) Returns true if the other delta is a complete subset of this delta. I.e. if all the statements of the other delta are already contained in this delta. As a consequence it also returns true if the two deltas are equal.
 - 
containsboolean contains(ItemDelta<V,D> other, EquivalenceStrategy strategy) Returns true if the other delta is a complete subset of this delta. I.e. if all the statements of the other delta are already contained in this delta. As a consequence it also returns true if the two deltas are equal.
 - 
filterYieldsvoid filterYields(BiFunction<V,PrismContainerValue,Boolean> function) 
 - 
toDeltaSetTriplePrismValueDeltaSetTriple<V> toDeltaSetTriple(Item<V,D> itemOld) throws SchemaException - Throws:
- SchemaException
 
 - 
assertDefinitionsvoid assertDefinitions(Supplier<String> sourceDescriptionSupplier) throws SchemaException - Throws:
- SchemaException
 
 - 
assertDefinitionsvoid assertDefinitions(boolean tolerateRawValues, Supplier<String> sourceDescriptionSupplier) throws SchemaException- Throws:
- SchemaException
 
 - 
isRawboolean isRaw() 
 - 
revivevoid revive(PrismContext prismContext) throws SchemaException - Throws:
- SchemaException
 
 - 
applyDefinitionvoid applyDefinition(D itemDefinition, boolean force) throws SchemaException - Throws:
- SchemaException
 
 - 
equivalentboolean equivalent(ItemDelta other) Deltas are equivalent if they have the same result when applied to an object. I.e. meta-data and other "decorations" such as old values are not considered in this comparison.
 - 
debugDumpString debugDump(int indent) - Specified by:
- debugDumpin interface- DebugDumpable
 
 - 
addToReplaceDeltavoid addToReplaceDelta() 
 - 
setOriginTypeRecursivevoid setOriginTypeRecursive(OriginType originType) Set origin type to all values and subvalues
 - 
isImmutableboolean isImmutable() - Specified by:
- isImmutablein interface- Freezable
 
 
- 
 
-