Interface ItemDelta<V extends PrismValue,​D extends ItemDefinition>

    • Method Detail

      • setElementName

        void setElementName​(QName elementName)
      • getParentPath

        ItemPath getParentPath()
      • setParentPath

        void setParentPath​(ItemPath parentPath)
      • setDefinition

        void setDefinition​(D definition)
      • accept

        void accept​(Visitor visitor,
                    boolean includeOldValues)
      • size

        int size()
      • hasCompleteDefinition

        boolean hasCompleteDefinition()
      • getItemClass

        Class<? extends Item> getItemClass()
      • clearValuesToAdd

        void clearValuesToAdd()
      • clearValuesToDelete

        void clearValuesToDelete()
      • getValuesToReplace

        Collection<V> getValuesToReplace()
      • clearValuesToReplace

        void clearValuesToReplace()
      • addValuesToAdd

        void addValuesToAdd​(Collection<V> newValues)
      • addValuesToAdd

        void addValuesToAdd​(V... newValues)
      • addValueToAdd

        void addValueToAdd​(V newValue)
      • removeValueToAdd

        boolean removeValueToAdd​(PrismValue valueToRemove)
      • removeValueToDelete

        boolean removeValueToDelete​(PrismValue valueToRemove)
      • removeValueToReplace

        boolean removeValueToReplace​(PrismValue valueToRemove)
      • mergeValuesToAdd

        void mergeValuesToAdd​(Collection<V> newValues)
      • mergeValuesToAdd

        void mergeValuesToAdd​(V[] newValues)
      • mergeValueToAdd

        void mergeValueToAdd​(V newValue)
      • addValuesToDelete

        void addValuesToDelete​(Collection<V> newValues)
      • addValuesToDelete

        void addValuesToDelete​(V... newValues)
      • addValueToDelete

        void addValueToDelete​(V newValue)
      • mergeValuesToDelete

        void mergeValuesToDelete​(Collection<V> newValues)
      • mergeValuesToDelete

        void mergeValuesToDelete​(V[] newValues)
      • mergeValueToDelete

        void mergeValueToDelete​(V newValue)
      • resetValuesToAdd

        void resetValuesToAdd()
      • resetValuesToDelete

        void resetValuesToDelete()
      • resetValuesToReplace

        void resetValuesToReplace()
      • setValuesToReplace

        void setValuesToReplace​(Collection<V> newValues)
      • setValuesToReplace

        void setValuesToReplace​(V... newValues)
      • setValueToReplace

        void setValueToReplace()
        Sets empty value to replace. This efficiently means removing all values.
      • setValueToReplace

        void setValueToReplace​(V newValue)
      • addValueToReplace

        void addValueToReplace​(V newValue)
      • mergeValuesToReplace

        void mergeValuesToReplace​(Collection<V> newValues)
      • mergeValuesToReplace

        void mergeValuesToReplace​(V[] newValues)
      • mergeValueToReplace

        void mergeValueToReplace​(V newValue)
      • isValueToAdd

        boolean isValueToAdd​(V value)
      • isValueToAdd

        boolean isValueToAdd​(V value,
                             boolean ignoreMetadata)
      • isValueToDelete

        boolean isValueToDelete​(V value)
      • isValueToDelete

        boolean isValueToDelete​(V value,
                                boolean ignoreMetadata)
      • isValueToReplace

        boolean isValueToReplace​(V value)
      • isValueToReplace

        boolean isValueToReplace​(V value,
                                 boolean ignoreMetadata)
      • getAnyValue

        V getAnyValue()
      • isEmpty

        boolean isEmpty()
      • isInFactEmpty

        boolean isInFactEmpty()
      • addsAnyValue

        boolean addsAnyValue()
      • foreach

        void foreach​(Processor<V> processor)
        Description copied from interface: Foreachable
        Will 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:
        foreach in interface Foreachable<V extends PrismValue>
      • getEstimatedOldValues

        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.
        Returns:
        estimated state of the old value before the delta is applied (may be null).
      • setEstimatedOldValues

        void setEstimatedOldValues​(Collection<V> estimatedOldValues)
      • addEstimatedOldValues

        void addEstimatedOldValues​(Collection<V> newValues)
      • addEstimatedOldValues

        void addEstimatedOldValues​(V... newValues)
      • addEstimatedOldValue

        void addEstimatedOldValue​(V newValue)
      • normalize

        void normalize()
      • isReplace

        boolean isReplace()
      • isAdd

        boolean isAdd()
      • isDelete

        boolean isDelete()
      • clear

        void clear()
      • narrow

        ItemDelta<V,​D> narrow​(PrismObject<? extends Objectable> object,
                                    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.
        Parameters:
        assumeMissingItems - Assumes that some items in the object may be missing. So replacing them by null or deleting some values from them cannot be narrowed out.
      • narrow

        ItemDelta<V,​D> narrow​(PrismObject<? extends Objectable> object,
                                    Comparator<V> comparator,
                                    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.
        Parameters:
        assumeMissingItems - Assumes that some items in the object may be missing. So replacing them by null or deleting some values from them cannot be narrowed out.
      • isRedundant

        boolean isRedundant​(PrismObject<? extends Objectable> object,
                            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 or deletes some values from them cannot be considered redundant.
      • isRedundant

        boolean isRedundant​(PrismObject<? extends Objectable> object,
                            Comparator<V> comparator,
                            boolean assumeMissingItems)
        Parameters:
        assumeMissingItems - Assumes that some items in the object may be missing. So delta that replaces them by null or deletes some values from them cannot be considered redundant.
      • checkConsistence

        void checkConsistence()
      • checkConsistence

        void checkConsistence​(boolean requireDefinition,
                              boolean prohibitRaw,
                              ConsistencyCheckScope scope)
      • distributeReplace

        void distributeReplace​(Collection<V> existingValues)
        Distributes the replace values of this delta to add and delete with respect to provided existing values.
      • merge

        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.
      • simplify

        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.
      • isApplicableTo

        boolean isApplicableTo​(Item item)
      • getItemNew

        Item<V,​D> getItemNew()
                            throws SchemaException
        Returns the "new" state of the property - the state that would be after the delta is applied.
        Throws:
        SchemaException
      • contains

        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.
      • contains

        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.
      • cloneWithChangedParentPath

        ItemDelta<V,​D> cloneWithChangedParentPath​(ItemPath newParentPath)
      • isRaw

        boolean isRaw()
      • equivalent

        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.
      • addToReplaceDelta

        void addToReplaceDelta()
      • createReverseDelta

        ItemDelta<V,​D> createReverseDelta()
      • findValueToAddOrReplace

        V findValueToAddOrReplace​(V value)
      • setOriginTypeRecursive

        void setOriginTypeRecursive​(OriginType originType)
        Set origin type to all values and subvalues
      • isImmutable

        boolean isImmutable()
      • setImmutable

        void setImmutable​(boolean immutable)