Class ItemDeltaImpl<V extends PrismValue,D extends ItemDefinition<?>>
- java.lang.Object
-
- com.evolveum.midpoint.prism.AbstractFreezable
-
- com.evolveum.midpoint.prism.impl.delta.ItemDeltaImpl<V,D>
-
- All Implemented Interfaces:
ItemDelta<V,D>,Freezable,Itemable,PathVisitable,PrismContextSensitive,Visitable,DebugDumpable,Foreachable<V>,Serializable
- Direct Known Subclasses:
ContainerDeltaImpl,PropertyDeltaImpl,ReferenceDeltaImpl
public abstract class ItemDeltaImpl<V extends PrismValue,D extends ItemDefinition<?>> extends AbstractFreezable implements ItemDelta<V,D>
- Author:
- Radovan Semancik
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected DdefinitionDefinition of the item.protected ItemNameelementNameName of the propertyprotected ItemPathparentPathParent path of the item (path to the property container)protected Collection<V>valuesToAddprotected Collection<V>valuesToDeleteprotected Collection<V>valuesToReplace-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete 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(@NotNull Item item)voidapplyTo(PrismContainerValue containerValue)voidapplyToMatchingPath(@NotNull 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()abstract ItemDeltaImpl<V,D>clone()ItemDeltaImpl<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.protected voidcopyValues(ItemDeltaImpl<V,D> clone)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.protected voiddumpValues(StringBuilder sb, String label, Collection<V> values, int indent)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.abstract 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)Returns the "new" state of the property - the state that would be after the delta is applied.ItemPathgetParentPath()@NotNull ItemPathgetPath()PrismContextgetPrismContext()ItemDelta<?,?>getSubDelta(ItemPath path)Collection<V>getValueChanges(PlusMinusZero mode)Collection<V>getValuesToAdd()Collection<V>getValuesToDelete()Collection<V>getValuesToReplace()booleanhasCompleteDefinition()inthashCode()booleanisAdd()booleanisApplicableTo(Item item)protected abstract booleanisApplicableToType(Item item)booleanisDelete()booleanisEmpty()booleanisLiterallyEmpty()The original semantics ofItemDelta.isEmpty()method: returns true if all of values to add, delete, replace are null.booleanisRaw()booleanisRedundant(PrismObject<? extends Objectable> object, @NotNull ParameterizedEquivalenceStrategy strategy, boolean assumeMissingItems)Checks if the delta is redundant w.r.t.booleanisReplace()protected booleanisValueEquivalent(V a, V b, ParameterizedEquivalenceStrategy strategy)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(@NotNull PrismObject<? extends Objectable> object, @NotNull Comparator<V> plusComparator, @NotNull Comparator<V> minusComparator, boolean assumeMissingItems)Filters out all delta values that are meaningless to apply.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 class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutable, performFreeze
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze
-
Methods inherited from interface com.evolveum.midpoint.prism.delta.ItemDelta
getRealValuesToAdd, getRealValuesToDelete, getRealValuesToReplace, isImmutable, isOperational
-
-
-
-
Field Detail
-
elementName
protected ItemName elementName
Name of the property
-
parentPath
protected ItemPath parentPath
Parent path of the item (path to the property container)
-
definition
protected D extends ItemDefinition<?> definition
Definition of the item.
-
valuesToReplace
protected Collection<V extends PrismValue> valuesToReplace
-
valuesToAdd
protected Collection<V extends PrismValue> valuesToAdd
-
valuesToDelete
protected Collection<V extends PrismValue> valuesToDelete
-
-
Method Detail
-
getElementName
public ItemName getElementName()
- Specified by:
getElementNamein interfaceItemable- Specified by:
getElementNamein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
setElementName
public void setElementName(QName elementName)
- Specified by:
setElementNamein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
getParentPath
public ItemPath getParentPath()
- Specified by:
getParentPathin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
setParentPath
public void setParentPath(ItemPath parentPath)
- Specified by:
setParentPathin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
getPath
@NotNull public @NotNull ItemPath getPath()
- Specified by:
getPathin interfaceItemable- Specified by:
getPathin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
getDefinition
public D getDefinition()
- Specified by:
getDefinitionin interfaceItemable- Specified by:
getDefinitionin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
setDefinition
public void setDefinition(D definition)
- Specified by:
setDefinitionin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
accept
public void accept(Visitor visitor)
- Specified by:
acceptin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Specified by:
acceptin interfaceVisitable<V extends PrismValue>
-
accept
public void accept(Visitor visitor, boolean includeOldValues)
- Specified by:
acceptin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
size
public int size()
- Specified by:
sizein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
accept
public void accept(Visitor visitor, ItemPath path, boolean recursive)
- Specified by:
acceptin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Specified by:
acceptin interfacePathVisitable
-
applyDefinition
public void applyDefinition(D definition) throws SchemaException
- Specified by:
applyDefinitionin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Throws:
SchemaException
-
hasCompleteDefinition
public boolean hasCompleteDefinition()
- Specified by:
hasCompleteDefinitionin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
getPrismContext
public PrismContext getPrismContext()
- Specified by:
getPrismContextin interfacePrismContextSensitive
-
getItemClass
public abstract Class<? extends Item> getItemClass()
- Specified by:
getItemClassin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
getValuesToAdd
public Collection<V> getValuesToAdd()
- Specified by:
getValuesToAddin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
clearValuesToAdd
public void clearValuesToAdd()
- Specified by:
clearValuesToAddin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
getValuesToDelete
public Collection<V> getValuesToDelete()
- Specified by:
getValuesToDeletein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
clearValuesToDelete
public void clearValuesToDelete()
- Specified by:
clearValuesToDeletein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
getValuesToReplace
public Collection<V> getValuesToReplace()
- Specified by:
getValuesToReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
clearValuesToReplace
public void clearValuesToReplace()
- Specified by:
clearValuesToReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
addValuesToAdd
public void addValuesToAdd(Collection<V> newValues)
- Specified by:
addValuesToAddin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
addValuesToAdd
public void addValuesToAdd(V... newValues)
- Specified by:
addValuesToAddin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
addValueToAdd
public void addValueToAdd(V newValue)
- Specified by:
addValueToAddin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
removeValueToAdd
public boolean removeValueToAdd(PrismValue valueToRemove)
- Specified by:
removeValueToAddin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
removeValueToDelete
public boolean removeValueToDelete(PrismValue valueToRemove)
- Specified by:
removeValueToDeletein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
removeValueToReplace
public boolean removeValueToReplace(PrismValue valueToRemove)
- Specified by:
removeValueToReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
mergeValuesToAdd
public void mergeValuesToAdd(Collection<V> newValues)
- Specified by:
mergeValuesToAddin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
mergeValuesToAdd
public void mergeValuesToAdd(V[] newValues)
- Specified by:
mergeValuesToAddin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
mergeValueToAdd
public void mergeValueToAdd(V newValue)
- Specified by:
mergeValueToAddin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
addValuesToDelete
public void addValuesToDelete(Collection<V> newValues)
- Specified by:
addValuesToDeletein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
addValuesToDelete
public void addValuesToDelete(V... newValues)
- Specified by:
addValuesToDeletein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
addValueToDelete
public void addValueToDelete(V newValue)
- Specified by:
addValueToDeletein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
isValueEquivalent
protected boolean isValueEquivalent(V a, V b, ParameterizedEquivalenceStrategy strategy)
-
mergeValuesToDelete
public void mergeValuesToDelete(Collection<V> newValues)
- Specified by:
mergeValuesToDeletein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
mergeValuesToDelete
public void mergeValuesToDelete(V[] newValues)
- Specified by:
mergeValuesToDeletein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
mergeValueToDelete
public void mergeValueToDelete(V newValue)
- Specified by:
mergeValueToDeletein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
resetValuesToAdd
public void resetValuesToAdd()
- Specified by:
resetValuesToAddin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
resetValuesToDelete
public void resetValuesToDelete()
- Specified by:
resetValuesToDeletein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
resetValuesToReplace
public void resetValuesToReplace()
- Specified by:
resetValuesToReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
setValuesToReplace
public void setValuesToReplace(Collection<V> newValues)
- Specified by:
setValuesToReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
setValuesToReplace
public void setValuesToReplace(V... newValues)
- Specified by:
setValuesToReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
setValueToReplace
public void setValueToReplace()
Sets empty value to replace. This efficiently means removing all values.- Specified by:
setValueToReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
setValueToReplace
public void setValueToReplace(V newValue)
- Specified by:
setValueToReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
addValueToReplace
public void addValueToReplace(V newValue)
- Specified by:
addValueToReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
mergeValuesToReplace
public void mergeValuesToReplace(Collection<V> newValues)
- Specified by:
mergeValuesToReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
mergeValuesToReplace
public void mergeValuesToReplace(V[] newValues)
- Specified by:
mergeValuesToReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
mergeValueToReplace
public void mergeValueToReplace(V newValue)
- Specified by:
mergeValueToReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
isValueToAdd
public boolean isValueToAdd(V value)
- Specified by:
isValueToAddin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
isValueToDelete
public boolean isValueToDelete(V value)
- Specified by:
isValueToDeletein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
isValueToReplace
public boolean isValueToReplace(V value)
- Specified by:
isValueToReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
getAnyValue
public V getAnyValue()
- Specified by:
getAnyValuein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
isLiterallyEmpty
public boolean isLiterallyEmpty()
Description copied from interface:ItemDeltaThe original semantics ofItemDelta.isEmpty()method: returns true if all of values to add, delete, replace are null. TODO is this really needed?- Specified by:
isLiterallyEmptyin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
addsAnyValue
public boolean addsAnyValue()
- Specified by:
addsAnyValuein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
foreach
public void 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 interfaceForeachable<V extends PrismValue>- Specified by:
foreachin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
getEstimatedOldValues
public Collection<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.
- Specified by:
getEstimatedOldValuesin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Returns:
- estimated state of the old value before the delta is applied (may be null).
-
setEstimatedOldValues
public void setEstimatedOldValues(Collection<V> estimatedOldValues)
- Specified by:
setEstimatedOldValuesin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
addEstimatedOldValues
public void addEstimatedOldValues(Collection<V> newValues)
- Specified by:
addEstimatedOldValuesin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
addEstimatedOldValues
public void addEstimatedOldValues(V... newValues)
- Specified by:
addEstimatedOldValuesin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
addEstimatedOldValue
public void addEstimatedOldValue(V newValue)
- Specified by:
addEstimatedOldValuein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
normalize
public void normalize()
- Specified by:
normalizein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
isReplace
public boolean isReplace()
- Specified by:
isReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
isAdd
public boolean isAdd()
- Specified by:
isAddin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
isDelete
public boolean isDelete()
- Specified by:
isDeletein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
clear
public void clear()
- Specified by:
clearin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
narrow
public ItemDelta<V,D> narrow(@NotNull @NotNull PrismObject<? extends Objectable> object, @NotNull @NotNull Comparator<V> plusComparator, @NotNull @NotNull Comparator<V> minusComparator, boolean assumeMissingItems)
Filters out all delta values that are meaningless to apply. E.g. removes all values to add that the property already has, removes all values to delete that the property does not have, etc. Returns null if the delta is not needed at all. See description on the interface.- Specified by:
narrowin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>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.
-
isRedundant
public boolean isRedundant(PrismObject<? extends Objectable> object, @NotNull @NotNull ParameterizedEquivalenceStrategy strategy, boolean assumeMissingItems)
Description copied from interface:ItemDeltaChecks if the delta is redundant w.r.t. current state of the object. I.e. if it changes the current object state.- Specified by:
isRedundantin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>assumeMissingItems- Assumes that some items in the object may be missing. So delta that replaces them by null
-
validate
public void validate() throws SchemaException- Specified by:
validatein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Throws:
SchemaException
-
validate
public void validate(String contextDescription) throws SchemaException
- Specified by:
validatein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Throws:
SchemaException
-
validateValues
public void validateValues(ItemDeltaValidator<V> validator) throws SchemaException
- Specified by:
validateValuesin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Throws:
SchemaException
-
validateValues
public void validateValues(ItemDeltaValidator<V> validator, Collection<V> oldValues)
- Specified by:
validateValuesin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
checkConsistence
public void checkConsistence()
- Specified by:
checkConsistencein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
checkConsistence
public void checkConsistence(ConsistencyCheckScope scope)
- Specified by:
checkConsistencein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
checkConsistence
public void checkConsistence(boolean requireDefinition, boolean prohibitRaw, ConsistencyCheckScope scope)- Specified by:
checkConsistencein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
distributeReplace
public void distributeReplace(Collection<V> existingValues)
Distributes the replace values of this delta to add and delete with respect to provided existing values. TODO reconsider equivalence strategy!- Specified by:
distributeReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
merge
public void 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.
- Specified by:
mergein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
getValueChanges
public Collection<V> getValueChanges(PlusMinusZero mode)
- Specified by:
getValueChangesin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
simplify
public void simplify()
Transforms the delta to the simplest (and safest) form. E.g. it will transform add delta for single-value properties to replace delta.- Specified by:
simplifyin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
applyTo
public void applyTo(PrismContainerValue containerValue) throws SchemaException
- Specified by:
applyToin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Throws:
SchemaException
-
applyTo
public void applyTo(@NotNull @NotNull Item item) throws SchemaException- Specified by:
applyToin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Throws:
SchemaException
-
applyToMatchingPath
public void applyToMatchingPath(@NotNull @NotNull Item item) throws SchemaExceptionApplies delta to item. Assumes that path of the delta and path of the item matches (does not do path checks).- Specified by:
applyToMatchingPathin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Throws:
SchemaException
-
getSubDelta
public ItemDelta<?,?> getSubDelta(ItemPath path)
- Specified by:
getSubDeltain interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
isApplicableTo
public boolean isApplicableTo(Item item)
- Specified by:
isApplicableToin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
isApplicableToType
protected abstract boolean isApplicableToType(Item item)
-
getItemNew
public Item<V,D> getItemNew() throws SchemaException
Returns the "new" state of the property - the state that would be after the delta is applied.WARNING: Output of this method should be used for preview only. It should NOT be placed into prism structures. Not even cloned. This method may return dummy items or similar items that are not usable. Values in the items should be OK, but they may need cloning.
- Specified by:
getItemNewin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Throws:
SchemaException
-
getItemNew
public Item<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.WARNING: Output of this method should be used for preview only. It should NOT be placed into prism structures. Not even cloned. This method may return dummy items or similar items that are not usable. Values in the items should be OK, but they may need cloning.
- Specified by:
getItemNewin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Throws:
SchemaException
-
getItemNewMatchingPath
public Item<V,D> getItemNewMatchingPath(Item<V,D> itemOld) throws SchemaException
Returns the "new" state of the property - the state that would be after the delta is applied.WARNING: This is supposed to work only if the paths of the the delta and the item matches. E.g. it is NOT usable for application of subdeltas to containers.
- Specified by:
getItemNewMatchingPathin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Throws:
SchemaException
-
contains
public boolean 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.- Specified by:
containsin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
contains
public boolean 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.- Specified by:
containsin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
filterValues
public void filterValues(Function<V,Boolean> function)
- Specified by:
filterValuesin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
filterYields
public void filterYields(BiFunction<V,PrismContainerValue,Boolean> function)
- Specified by:
filterYieldsin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
clone
public abstract ItemDeltaImpl<V,D> clone()
- Specified by:
clonein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Overrides:
clonein classObject
-
cloneWithChangedParentPath
public ItemDeltaImpl<V,D> cloneWithChangedParentPath(ItemPath newParentPath)
- Specified by:
cloneWithChangedParentPathin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
copyValues
protected void copyValues(ItemDeltaImpl<V,D> clone)
-
toDeltaSetTriple
public PrismValueDeltaSetTriple<V> toDeltaSetTriple(Item<V,D> itemOld) throws SchemaException
- Specified by:
toDeltaSetTriplein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Throws:
SchemaException
-
assertDefinitions
public void assertDefinitions(Supplier<String> sourceDescriptionSupplier) throws SchemaException
- Specified by:
assertDefinitionsin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Throws:
SchemaException
-
assertDefinitions
public void assertDefinitions(boolean tolerateRawValues, Supplier<String> sourceDescriptionSupplier) throws SchemaException- Specified by:
assertDefinitionsin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Throws:
SchemaException
-
isRaw
public boolean isRaw()
- Specified by:
isRawin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
revive
public void revive(PrismContext prismContext) throws SchemaException
- Specified by:
revivein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Throws:
SchemaException
-
applyDefinition
public void applyDefinition(D itemDefinition, boolean force) throws SchemaException
- Specified by:
applyDefinitionin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Throws:
SchemaException
-
equivalent
public boolean 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.- Specified by:
equivalentin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
equals
public boolean equals(Object obj)
- Specified by:
equalsin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Overrides:
equalsin classObject
-
toString
public String toString()
- Specified by:
toStringin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>- Overrides:
toStringin classObject
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDumpin interfaceDebugDumpable- Specified by:
debugDumpin interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
dumpValues
protected void dumpValues(StringBuilder sb, String label, Collection<V> values, int indent)
-
addToReplaceDelta
public void addToReplaceDelta()
- Specified by:
addToReplaceDeltain interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
createReverseDelta
public ItemDelta<V,D> createReverseDelta()
- Specified by:
createReverseDeltain interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
findValueToAddOrReplace
public V findValueToAddOrReplace(V value)
- Specified by:
findValueToAddOrReplacein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
setOriginTypeRecursive
public void setOriginTypeRecursive(OriginType originType)
Set origin type to all values and subvalues- Specified by:
setOriginTypeRecursivein interfaceItemDelta<V extends PrismValue,D extends ItemDefinition<?>>
-
-