Class PropertyDeltaImpl<T>
java.lang.Object
com.evolveum.midpoint.prism.AbstractFreezable
com.evolveum.midpoint.prism.impl.delta.ItemDeltaImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
com.evolveum.midpoint.prism.impl.delta.PropertyDeltaImpl<T>
- All Implemented Interfaces:
ItemDelta<PrismPropertyValue<T>,,PrismPropertyDefinition<T>> PropertyDelta<T>,Freezable,Itemable,PathVisitable,PrismContextSensitive,Visitable,DebugDumpable,Foreachable<PrismPropertyValue<T>>,Serializable
public class PropertyDeltaImpl<T>
extends ItemDeltaImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
implements PropertyDelta<T>
Relative difference (delta) of a property values.
This class describes what values are to be added, removed or replaced in the property. The delta can be either add+delete or replace, but not both. It either describes what values to add and delete from the property (add+delete) or what is the new set of values (replace). Add+delete deltas can be merged without a loss. There are ideal for multi-value properties. If replace deltas are merged, only the last value will be present. These are better suited for single-value properties.
- Author:
- Radovan Semancik
- See Also:
-
Field Summary
Fields inherited from class com.evolveum.midpoint.prism.impl.delta.ItemDeltaImpl
definition, elementName, parentPath, valuesToAdd, valuesToDelete, valuesToReplaceFields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Constructor Summary
ConstructorsConstructorDescriptionPropertyDeltaImpl(ItemPath propertyPath, PrismPropertyDefinition<T> propertyDefinition, PrismContext prismContext) PropertyDeltaImpl(ItemPath itemPath, QName name, PrismPropertyDefinition<T> propertyDefinition, PrismContext prismContext) PropertyDeltaImpl(PrismPropertyDefinition<T> propertyDefinition, PrismContext prismContext) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddRealValuesToAdd(Collection<T> newValues) final voidaddRealValuesToAdd(T... newValues) final voidaddRealValuesToDelete(Collection<T> values) final voidaddRealValuesToDelete(T... newValues) clone()protected voidcopyValues(PropertyDeltaImpl<T> clone) static <O extends Objectable>
PropertyDeltacreateAddDelta(PrismContainerDefinition<O> containerDefinition, QName propertyName, Object... realValues) static <O extends Objectable>
PropertyDeltacreateDeleteDelta(PrismContainerDefinition<O> containerDefinition, QName propertyName, Object... realValues) static <O extends Objectable,T>
PropertyDelta<T>createDelta(ItemPath propertyPath, PrismObjectDefinition<O> objectDefinition) static <O extends Objectable,T>
PropertyDelta<T>createDelta(ItemPath propertyPath, Class<O> compileTimeClass, PrismContext prismContext) static <T> PropertyDelta<T>createModificationAddProperty(ItemPath propertyPath, PrismObjectDefinition<?> objectDefinition, T... propertyValues) static <T> PropertyDelta<T>createModificationAddProperty(ItemPath propertyPath, PrismPropertyDefinition propertyDefinition, T... propertyValues) static <T> PropertyDelta<T>createModificationDeleteProperty(ItemPath propertyPath, PrismObjectDefinition<?> objectDefinition, T... propertyValues) static <T> PropertyDelta<T>createModificationDeleteProperty(ItemPath propertyPath, PrismPropertyDefinition propertyDefinition, T... propertyValues) static <T> PropertyDelta<T>createModificationReplaceProperty(@NotNull ItemPath path, @NotNull PrismPropertyDefinition propertyDefinition, T... propertyValues) static <T> PropertyDelta<T>createModificationReplaceProperty(ItemPath propertyPath, PrismObjectDefinition<?> objectDefinition, Collection<T> propertyValues) static <T> PropertyDelta<T>createModificationReplaceProperty(ItemPath propertyPath, PrismObjectDefinition<?> objectDefinition, T... propertyValues) Convenience method for quick creation of object deltas that replace a single object property.static Collection<? extends ItemDelta<?,?>> createModificationReplacePropertyCollection(QName propertyName, PrismObjectDefinition<?> objectDefinition, Object... propertyValues) Convenience method for quick creation of object deltas that replace a single object property.static <O extends Objectable,T>
PropertyDelta<T>createReplaceDelta(PrismContainerDefinition<O> containerDefinition, QName propertyName, PrismPropertyValue<T>... pValues) static <O extends Objectable,T>
PropertyDelta<T>createReplaceDelta(PrismContainerDefinition<O> containerDefinition, QName propertyName, T... realValues) static <O extends Objectable,T>
PropertyDelta<T>createReplaceDeltaOrEmptyDelta(PrismObjectDefinition<O> objectDefinition, QName propertyName, T realValue) static <O extends Objectable>
PropertyDeltacreateReplaceEmptyDelta(PrismObjectDefinition<O> objectDefinition, ItemPath propertyPath) Create delta that deletes all values of the specified property.Returns the "new" state of the property - the state that would be after the delta is applied.getPropertyNewMatchingPath(PrismProperty<T> propertyOld) Returns the "new" state of the property - the state that would be after the delta is applied.<V> Collection<PrismPropertyValue<V>>Returns all values regardless of whether they are added or removed or replaced.<P extends PrismProperty>
PbooleanisApplicableToType(Item item) booleanisRealValueToAdd(PrismPropertyValue<?> value) booleanisRealValueToDelete(PrismPropertyValue<?> value) narrow(@NotNull PrismObject<? extends Objectable> object, @NotNull Comparator<PrismPropertyValue<T>> plusComparator, @NotNull Comparator<PrismPropertyValue<T>> minusComparator, boolean assumeMissingItems) Filters out all delta values that are meaningless to apply.voidsetPropertyDefinition(PrismPropertyDefinition<T> propertyDefinition) final voidsetRealValuesToReplace(T... newValues) Methods inherited from class com.evolveum.midpoint.prism.impl.delta.ItemDeltaImpl
accept, accept, accept, addEstimatedOldValue, addEstimatedOldValues, addEstimatedOldValues, addsAnyValue, addToReplaceDelta, addValuesToAdd, addValuesToAdd, addValuesToDelete, addValuesToDelete, addValueToAdd, addValueToDelete, addValueToReplace, applyDefinition, applyDefinition, applyTo, applyTo, applyToMatchingPath, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, clear, clearValuesToAdd, clearValuesToDelete, clearValuesToReplace, cloneWithChangedParentPath, contains, contains, copyValues, createReverseDelta, debugDump, distributeReplace, dumpValues, equals, equivalent, filterValues, filterYields, findValueToAddOrReplace, foreach, getAnyValue, getDefinition, getElementName, getEstimatedOldValues, getItemNew, getItemNew, getItemNewMatchingPath, getParentPath, getPath, getPrismContext, getSubDelta, getValueChanges, getValuesToAdd, getValuesToDelete, getValuesToReplace, hasCompleteDefinition, hashCode, isAdd, isApplicableTo, isDelete, isEmpty, isLiterallyEmpty, isRaw, isRedundant, isReplace, isValueEquivalent, isValueToAdd, isValueToDelete, isValueToReplace, merge, mergeValuesToAdd, mergeValuesToAdd, mergeValuesToDelete, mergeValuesToDelete, mergeValuesToReplace, mergeValuesToReplace, mergeValueToAdd, mergeValueToDelete, mergeValueToReplace, normalize, removeValueToAdd, removeValueToDelete, removeValueToReplace, resetValuesToAdd, resetValuesToDelete, resetValuesToReplace, revive, setDefinition, setElementName, setEstimatedOldValues, setOriginTypeRecursive, setParentPath, setValuesToReplace, setValuesToReplace, setValueToReplace, setValueToReplace, simplify, size, toDeltaSetTriple, toString, validate, validate, validateValues, validateValuesMethods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutable, performFreezeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freezeMethods inherited from interface com.evolveum.midpoint.prism.delta.ItemDelta
accept, accept, accept, addEstimatedOldValue, addEstimatedOldValues, addEstimatedOldValues, addsAnyValue, addToReplaceDelta, addValuesToAdd, addValuesToAdd, addValuesToDelete, addValuesToDelete, addValueToAdd, addValueToDelete, addValueToReplace, applyDefinition, applyTo, applyTo, applyToMatchingPath, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, clear, clearValuesToAdd, clearValuesToDelete, clearValuesToReplace, cloneWithChangedParentPath, contains, contains, createReverseDelta, debugDump, distributeReplace, equals, equivalent, filterValues, filterYields, findValueToAddOrReplace, foreach, getAnyValue, getDefinition, getElementName, getEstimatedOldValues, getItemNew, getItemNew, getItemNewMatchingPath, getParentPath, getPath, getRealValuesToAdd, getRealValuesToDelete, getRealValuesToReplace, getSubDelta, getValueChanges, getValuesToAdd, getValuesToDelete, getValuesToReplace, hasCompleteDefinition, isAdd, isApplicableTo, isDelete, isEmpty, isImmutable, isLiterallyEmpty, isOperational, isRaw, isRedundant, isReplace, isValueToAdd, isValueToDelete, isValueToReplace, merge, mergeValuesToAdd, mergeValuesToAdd, mergeValuesToDelete, mergeValuesToDelete, mergeValuesToReplace, mergeValuesToReplace, mergeValueToAdd, mergeValueToDelete, mergeValueToReplace, normalize, removeValueToAdd, removeValueToDelete, removeValueToReplace, resetValuesToAdd, resetValuesToDelete, resetValuesToReplace, revive, setElementName, setEstimatedOldValues, setOriginTypeRecursive, setParentPath, setValuesToReplace, setValuesToReplace, setValueToReplace, setValueToReplace, simplify, size, toDeltaSetTriple, toString, validate, validate, validateValues, validateValuesMethods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContextMethods inherited from interface com.evolveum.midpoint.prism.delta.PropertyDelta
applyDefinition, setDefinition
-
Constructor Details
-
PropertyDeltaImpl
-
PropertyDeltaImpl
public PropertyDeltaImpl(ItemPath itemPath, QName name, PrismPropertyDefinition<T> propertyDefinition, PrismContext prismContext) -
PropertyDeltaImpl
public PropertyDeltaImpl(ItemPath propertyPath, PrismPropertyDefinition<T> propertyDefinition, PrismContext prismContext)
-
-
Method Details
-
getPropertyDefinition
- Specified by:
getPropertyDefinitionin interfacePropertyDelta<T>
-
setPropertyDefinition
- Specified by:
setPropertyDefinitionin interfacePropertyDelta<T>
-
getItemClass
- Specified by:
getItemClassin interfaceItemDelta<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Specified by:
getItemClassin interfacePropertyDelta<T>- Specified by:
getItemClassin classItemDeltaImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
getValues
Returns all values regardless of whether they are added or removed or replaced. Useful for iterating over all the changed values.- Specified by:
getValuesin interfacePropertyDelta<T>
-
getAnyRealValue
- Specified by:
getAnyRealValuein interfacePropertyDelta<T>
-
instantiateEmptyProperty
- Specified by:
instantiateEmptyPropertyin interfacePropertyDelta<T>
-
isApplicableToType
- Specified by:
isApplicableToTypein interfacePropertyDelta<T>- Specified by:
isApplicableToTypein classItemDeltaImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
clone
- Specified by:
clonein interfaceItemDelta<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Specified by:
clonein interfacePropertyDelta<T>- Specified by:
clonein classItemDeltaImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
copyValues
-
createReplaceDelta
public static <O extends Objectable,T> PropertyDelta<T> createReplaceDelta(PrismContainerDefinition<O> containerDefinition, QName propertyName, T... realValues) -
createReplaceDelta
public static <O extends Objectable,T> PropertyDelta<T> createReplaceDelta(PrismContainerDefinition<O> containerDefinition, QName propertyName, PrismPropertyValue<T>... pValues) -
createAddDelta
public static <O extends Objectable> PropertyDelta createAddDelta(PrismContainerDefinition<O> containerDefinition, QName propertyName, Object... realValues) -
createDeleteDelta
public static <O extends Objectable> PropertyDelta createDeleteDelta(PrismContainerDefinition<O> containerDefinition, QName propertyName, Object... realValues) -
createReplaceEmptyDelta
public static <O extends Objectable> PropertyDelta createReplaceEmptyDelta(PrismObjectDefinition<O> objectDefinition, ItemPath propertyPath) Create delta that deletes all values of the specified property. -
createReplaceDeltaOrEmptyDelta
public static <O extends Objectable,T> PropertyDelta<T> createReplaceDeltaOrEmptyDelta(PrismObjectDefinition<O> objectDefinition, QName propertyName, T realValue) -
isRealValueToAdd
- Specified by:
isRealValueToAddin interfacePropertyDelta<T>
-
isRealValueToDelete
- Specified by:
isRealValueToDeletein interfacePropertyDelta<T>
-
getPropertyNewMatchingPath
Returns the "new" state of the property - the state that would be after the delta is applied.- Specified by:
getPropertyNewMatchingPathin interfacePropertyDelta<T>- Throws:
SchemaException
-
getPropertyNewMatchingPath
public PrismProperty<T> getPropertyNewMatchingPath(PrismProperty<T> propertyOld) throws SchemaException Returns the "new" state of the property - the state that would be after the delta is applied.- Specified by:
getPropertyNewMatchingPathin interfacePropertyDelta<T>- Throws:
SchemaException
-
createDelta
public static <O extends Objectable,T> PropertyDelta<T> createDelta(ItemPath propertyPath, PrismObjectDefinition<O> objectDefinition) -
createDelta
public static <O extends Objectable,T> PropertyDelta<T> createDelta(ItemPath propertyPath, Class<O> compileTimeClass, PrismContext prismContext) -
createModificationReplaceProperty
public static <T> PropertyDelta<T> createModificationReplaceProperty(ItemPath propertyPath, PrismObjectDefinition<?> objectDefinition, T... propertyValues) Convenience method for quick creation of object deltas that replace a single object property. This is used quite often to justify a separate method. -
createModificationReplaceProperty
public static <T> PropertyDelta<T> createModificationReplaceProperty(ItemPath propertyPath, PrismObjectDefinition<?> objectDefinition, Collection<T> propertyValues) -
createModificationReplaceProperty
public static <T> PropertyDelta<T> createModificationReplaceProperty(@NotNull @NotNull ItemPath path, @NotNull @NotNull PrismPropertyDefinition propertyDefinition, T... propertyValues) -
createModificationAddProperty
public static <T> PropertyDelta<T> createModificationAddProperty(ItemPath propertyPath, PrismPropertyDefinition propertyDefinition, T... propertyValues) -
createModificationAddProperty
public static <T> PropertyDelta<T> createModificationAddProperty(ItemPath propertyPath, PrismObjectDefinition<?> objectDefinition, T... propertyValues) -
createModificationDeleteProperty
public static <T> PropertyDelta<T> createModificationDeleteProperty(ItemPath propertyPath, PrismPropertyDefinition propertyDefinition, T... propertyValues) -
createModificationDeleteProperty
public static <T> PropertyDelta<T> createModificationDeleteProperty(ItemPath propertyPath, PrismObjectDefinition<?> objectDefinition, T... propertyValues) -
createModificationReplacePropertyCollection
public static Collection<? extends ItemDelta<?,?>> createModificationReplacePropertyCollection(QName propertyName, PrismObjectDefinition<?> objectDefinition, Object... propertyValues) Convenience method for quick creation of object deltas that replace a single object property. This is used quite often to justify a separate method. -
setRealValuesToReplace
- Specified by:
setRealValuesToReplacein interfacePropertyDelta<T>
-
addRealValuesToAdd
- Specified by:
addRealValuesToAddin interfacePropertyDelta<T>
-
addRealValuesToDelete
- Specified by:
addRealValuesToDeletein interfacePropertyDelta<T>
-
addRealValuesToAdd
- Specified by:
addRealValuesToAddin interfacePropertyDelta<T>
-
addRealValuesToDelete
- Specified by:
addRealValuesToDeletein interfacePropertyDelta<T>
-
narrow
public PropertyDelta<T> narrow(@NotNull @NotNull PrismObject<? extends Objectable> object, @NotNull @NotNull Comparator<PrismPropertyValue<T>> plusComparator, @NotNull @NotNull Comparator<PrismPropertyValue<T>> minusComparator, boolean assumeMissingItems) Description copied from class:ItemDeltaImplFilters 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<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Specified by:
narrowin interfacePropertyDelta<T>- Overrides:
narrowin classItemDeltaImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>> 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.
-