public abstract class ItemDelta<V extends PrismValue,D extends ItemDefinition> extends Object implements Itemable, DebugDumpable, Visitable, PathVisitable, Serializable
Modifier and Type | Field and Description |
---|---|
protected D |
definition |
protected QName |
elementName
Name of the property
|
protected Collection<V> |
estimatedOldValues |
protected ItemPath |
parentPath
Parent path of the property (path to the property container)
|
protected Collection<V> |
valuesToAdd |
protected Collection<V> |
valuesToDelete |
protected Collection<V> |
valuesToReplace |
INDENT_STRING
Modifier | Constructor and Description |
---|---|
protected |
ItemDelta(D itemDefinition,
PrismContext prismContext) |
protected |
ItemDelta(ItemPath path,
D itemDefinition,
PrismContext prismContext) |
protected |
ItemDelta(ItemPath parentPath,
QName elementName,
D itemDefinition,
PrismContext prismContext) |
protected |
ItemDelta(QName elementName,
D itemDefinition,
PrismContext prismContext) |
Modifier and Type | Method and Description |
---|---|
static void |
accept(Collection<? extends ItemDelta> modifications,
Visitor visitor,
ItemPath path,
boolean recursive) |
void |
accept(Visitor visitor) |
void |
accept(Visitor visitor,
boolean includeOldValues) |
void |
accept(Visitor visitor,
ItemPath path,
boolean recursive) |
static void |
addAll(Collection<? extends ItemDelta> modifications,
Collection<? extends ItemDelta> deltasToAdd) |
void |
addEstimatedOldValue(V newValue) |
void |
addEstimatedOldValues(Collection<V> newValues) |
void |
addEstimatedOldValues(V... newValues) |
boolean |
addsAnyValue() |
void |
addToReplaceDelta() |
void |
addValuesToAdd(Collection<V> newValues) |
void |
addValuesToAdd(V... newValues) |
void |
addValuesToDelete(Collection<V> newValues) |
void |
addValuesToDelete(V... newValues) |
void |
addValueToAdd(V newValue) |
void |
addValueToDelete(V newValue) |
void |
addValueToReplace(V newValue) |
static void |
applyDefinition(Collection<? extends ItemDelta> deltas,
PrismObjectDefinition definition) |
void |
applyDefinition(D definition) |
void |
applyDefinition(D itemDefinition,
boolean force) |
static void |
applyTo(Collection<? extends ItemDelta> deltas,
PrismContainer propertyContainer) |
void |
applyTo(Item item) |
void |
applyTo(PrismContainerValue containerValue) |
static void |
applyToMatchingPath(Collection<? extends ItemDelta> deltas,
PrismContainer propertyContainer) |
void |
applyToMatchingPath(Item item)
Applies delta to item were path of the delta and path of the item matches (skips path checks).
|
void |
assertDefinitions(boolean tolarateRawValues,
String sourceDescription) |
void |
assertDefinitions(String sourceDescription) |
void |
checkConsistence() |
void |
checkConsistence(boolean requireDefinition,
boolean prohibitRaw,
ConsistencyCheckScope scope) |
static void |
checkConsistence(Collection<? extends ItemDelta> deltas) |
static void |
checkConsistence(Collection<? extends ItemDelta> deltas,
boolean requireDefinition,
boolean prohibitRaw,
ConsistencyCheckScope scope) |
static void |
checkConsistence(Collection<? extends ItemDelta> deltas,
ConsistencyCheckScope scope) |
void |
checkConsistence(ConsistencyCheckScope scope) |
void |
clear() |
void |
clearValuesToAdd() |
void |
clearValuesToDelete() |
void |
clearValuesToReplace() |
abstract ItemDelta<V,D> |
clone() |
static <D extends ItemDelta<?,?>> |
cloneCollection(Collection<D> orig) |
boolean |
contains(ItemDelta<V,D> other)
Returns true if the other delta is a complete subset of this delta.
|
protected boolean |
containsEquivalentValue(Collection<V> collection,
V value) |
protected void |
copyValues(ItemDelta<V,D> clone) |
String |
debugDump()
Show the content of the object intended for diagnostics by system administrator.
|
String |
debugDump(int indent) |
void |
distributeReplace(Collection<V> existingValues)
Distributes the replace values of this delta to add and delete with
respect to provided existing values.
|
protected void |
dumpValues(StringBuilder sb,
String label,
Collection<V> values,
int indent) |
boolean |
equals(Object obj) |
boolean |
equivalent(ItemDelta other)
Deltas are equivalent if they have the same result when
applied to an object.
|
static <X extends Containerable> |
findContainerDelta(Collection<? extends ItemDelta> deltas,
ItemPath propertyPath) |
static <X extends Containerable> |
findContainerDelta(Collection<? extends ItemDelta> deltas,
QName name) |
static <DD extends ItemDelta> |
findItemDelta(Collection<? extends ItemDelta> deltas,
ItemPath propertyPath,
Class<DD> deltaType) |
static <D extends ItemDelta> |
findItemDelta(Collection<? extends ItemDelta> deltas,
QName itemName,
Class<D> deltaType) |
static Collection<? extends ItemDelta<?,?>> |
findItemDeltasSubPath(Collection<? extends ItemDelta<?,?>> deltas,
ItemPath itemPath) |
static <T> PropertyDelta<T> |
findPropertyDelta(Collection<? extends ItemDelta> deltas,
ItemPath propertyPath) |
static <T> PropertyDelta<T> |
findPropertyDelta(Collection<? extends ItemDelta> deltas,
ItemPath parentPath,
QName propertyName) |
static <T> PropertyDelta<T> |
findPropertyDelta(Collection<? extends ItemDelta> deltas,
QName propertyName) |
static ReferenceDelta |
findReferenceModification(Collection<? extends ItemDelta> deltas,
QName itemName) |
V |
getAnyValue() |
D |
getDefinition() |
QName |
getElementName() |
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) |
ItemPath |
getParentPath() |
ItemPath |
getPath() |
PrismContext |
getPrismContext() |
ItemDelta<?,?> |
getSubDelta(ItemPath path) |
Collection<V> |
getValuesToAdd() |
Collection<V> |
getValuesToDelete() |
Collection<V> |
getValuesToReplace() |
boolean |
hasCompleteDefinition() |
static boolean |
hasEquivalent(Collection<? extends ItemDelta> col,
ItemDelta delta) |
int |
hashCode() |
boolean |
isAdd() |
boolean |
isApplicableTo(Item item) |
protected abstract boolean |
isApplicableToType(Item item) |
boolean |
isDelete() |
boolean |
isEmpty() |
static boolean |
isEmpty(ItemDeltaType itemDeltaType) |
boolean |
isRaw() |
boolean |
isRedundant(PrismObject<? extends Objectable> object)
Checks if the delta is redundant w.r.t.
|
boolean |
isRedundant(PrismObject<? extends Objectable> object,
Comparator<V> comparator) |
boolean |
isReplace() |
protected boolean |
isValueEquivalent(V a,
V b) |
boolean |
isValueToAdd(V value) |
boolean |
isValueToAdd(V value,
boolean ignoreMetadata) |
boolean |
isValueToDelete(V value) |
boolean |
isValueToDelete(V value,
boolean ignoreMetadata) |
boolean |
isValueToReplace(V value) |
boolean |
isValueToReplace(V value,
boolean ignoreMetadata) |
static void |
merge(Collection<? extends ItemDelta> modifications,
ItemDelta delta) |
void |
merge(ItemDelta<V,D> deltaToMerge)
Merge specified delta to this delta.
|
static void |
mergeAll(Collection<? extends ItemDelta> modifications,
Collection<? extends ItemDelta> deltasToMerge) |
void |
mergeValuesToAdd(Collection<V> newValues) |
void |
mergeValuesToAdd(V[] newValues) |
void |
mergeValuesToDelete(Collection<V> newValues) |
void |
mergeValuesToDelete(V[] newValues) |
void |
mergeValuesToReplace(Collection<V> newValues) |
void |
mergeValuesToReplace(V[] newValues) |
void |
mergeValueToAdd(V newValue) |
void |
mergeValueToDelete(V newValue) |
void |
mergeValueToReplace(V newValue) |
ItemDelta<V,D> |
narrow(PrismObject<? extends Objectable> object)
Filters out all delta values that are meaningless to apply.
|
ItemDelta<V,D> |
narrow(PrismObject<? extends Objectable> object,
Comparator<V> comparator)
Filters out all delta values that are meaningless to apply.
|
void |
normalize() |
static <D extends ItemDelta> |
removeItemDelta(Collection<? extends ItemDelta> deltas,
ItemDelta deltaToRemove) |
static <D extends ItemDelta> |
removeItemDelta(Collection<? extends ItemDelta> deltas,
ItemPath propertyPath,
Class<D> deltaType) |
boolean |
removeValueToAdd(V valueToRemove) |
boolean |
removeValueToDelete(V valueToRemove) |
boolean |
removeValueToReplace(V valueToRemove) |
void |
resetValuesToAdd() |
void |
resetValuesToDelete() |
void |
resetValuesToReplace() |
void |
revive(PrismContext prismContext) |
void |
setDefinition(D definition) |
void |
setElementName(QName elementName) |
void |
setEstimatedOldValues(Collection<V> estimatedOldValues) |
void |
setParentPath(ItemPath parentPath) |
void |
setValuesToReplace(Collection<V> newValues) |
void |
setValuesToReplace(V... newValues) |
void |
setValueToReplace()
Sets empty value to replace.
|
void |
setValueToReplace(V newValue) |
void |
simplify()
Transforms the delta to the simplest (and safest) form.
|
PrismValueDeltaSetTriple<V> |
toDeltaSetTriple() |
static <IV extends PrismValue,ID extends ItemDefinition> |
toDeltaSetTriple(Item<IV,ID> item,
ItemDelta<IV,ID> delta) |
static <IV extends PrismValue,ID extends ItemDefinition> |
toDeltaSetTriple(Item<IV,ID> item,
ItemDelta<IV,ID> delta,
boolean oldValuesValid,
boolean newValuesValid)
Deprecated.
|
PrismValueDeltaSetTriple<V> |
toDeltaSetTriple(Item<V,D> itemOld) |
String |
toString() |
void |
validate() |
void |
validate(String contextDescription) |
protected QName elementName
protected ItemPath parentPath
protected D extends ItemDefinition definition
protected Collection<V extends PrismValue> valuesToReplace
protected Collection<V extends PrismValue> valuesToAdd
protected Collection<V extends PrismValue> valuesToDelete
protected Collection<V extends PrismValue> estimatedOldValues
protected ItemDelta(D itemDefinition, PrismContext prismContext)
protected ItemDelta(QName elementName, D itemDefinition, PrismContext prismContext)
protected ItemDelta(ItemPath parentPath, QName elementName, D itemDefinition, PrismContext prismContext)
protected ItemDelta(ItemPath path, D itemDefinition, PrismContext prismContext)
public QName getElementName()
getElementName
in interface Itemable
public void setElementName(QName elementName)
public ItemPath getParentPath()
public void setParentPath(ItemPath parentPath)
public D getDefinition()
getDefinition
in interface Itemable
public void setDefinition(D definition)
public void accept(Visitor visitor, boolean includeOldValues)
public void accept(Visitor visitor, ItemPath path, boolean recursive)
accept
in interface PathVisitable
public void applyDefinition(D definition) throws SchemaException
SchemaException
public static void applyDefinition(Collection<? extends ItemDelta> deltas, PrismObjectDefinition definition) throws SchemaException
SchemaException
public boolean hasCompleteDefinition()
public PrismContext getPrismContext()
getPrismContext
in interface Itemable
public Collection<V> getValuesToAdd()
public void clearValuesToAdd()
public Collection<V> getValuesToDelete()
public void clearValuesToDelete()
public Collection<V> getValuesToReplace()
public void clearValuesToReplace()
public void addValuesToAdd(Collection<V> newValues)
public void addValuesToAdd(V... newValues)
public void addValueToAdd(V newValue)
public boolean removeValueToAdd(V valueToRemove)
public boolean removeValueToDelete(V valueToRemove)
public boolean removeValueToReplace(V valueToRemove)
public void mergeValuesToAdd(Collection<V> newValues)
public void mergeValuesToAdd(V[] newValues)
public void mergeValueToAdd(V newValue)
public void addValuesToDelete(Collection<V> newValues)
public void addValuesToDelete(V... newValues)
public void addValueToDelete(V newValue)
protected boolean containsEquivalentValue(Collection<V> collection, V value)
public void mergeValuesToDelete(Collection<V> newValues)
public void mergeValuesToDelete(V[] newValues)
public void mergeValueToDelete(V newValue)
public void resetValuesToAdd()
public void resetValuesToDelete()
public void resetValuesToReplace()
public void setValuesToReplace(Collection<V> newValues)
public void setValuesToReplace(V... newValues)
public void setValueToReplace()
public void setValueToReplace(V newValue)
public void addValueToReplace(V newValue)
public void mergeValuesToReplace(Collection<V> newValues)
public void mergeValuesToReplace(V[] newValues)
public void mergeValueToReplace(V newValue)
public boolean isValueToAdd(V value)
public boolean isValueToAdd(V value, boolean ignoreMetadata)
public boolean isValueToDelete(V value)
public boolean isValueToDelete(V value, boolean ignoreMetadata)
public boolean isValueToReplace(V value)
public boolean isValueToReplace(V value, boolean ignoreMetadata)
public V getAnyValue()
public boolean isEmpty()
public static boolean isEmpty(ItemDeltaType itemDeltaType)
public boolean addsAnyValue()
public Collection<V> getEstimatedOldValues()
public void setEstimatedOldValues(Collection<V> estimatedOldValues)
public void addEstimatedOldValues(Collection<V> newValues)
public void addEstimatedOldValues(V... newValues)
public void addEstimatedOldValue(V newValue)
public void normalize()
public boolean isReplace()
public boolean isAdd()
public boolean isDelete()
public void clear()
public static <T> PropertyDelta<T> findPropertyDelta(Collection<? extends ItemDelta> deltas, QName propertyName)
public static <T> PropertyDelta<T> findPropertyDelta(Collection<? extends ItemDelta> deltas, ItemPath parentPath, QName propertyName)
public static <T> PropertyDelta<T> findPropertyDelta(Collection<? extends ItemDelta> deltas, ItemPath propertyPath)
public static <X extends Containerable> ContainerDelta<X> findContainerDelta(Collection<? extends ItemDelta> deltas, ItemPath propertyPath)
public static <X extends Containerable> ContainerDelta<X> findContainerDelta(Collection<? extends ItemDelta> deltas, QName name)
public static <DD extends ItemDelta> DD findItemDelta(Collection<? extends ItemDelta> deltas, ItemPath propertyPath, Class<DD> deltaType)
public static Collection<? extends ItemDelta<?,?>> findItemDeltasSubPath(Collection<? extends ItemDelta<?,?>> deltas, ItemPath itemPath)
public static <D extends ItemDelta> D findItemDelta(Collection<? extends ItemDelta> deltas, QName itemName, Class<D> deltaType)
public static ReferenceDelta findReferenceModification(Collection<? extends ItemDelta> deltas, QName itemName)
public static <D extends ItemDelta> void removeItemDelta(Collection<? extends ItemDelta> deltas, ItemPath propertyPath, Class<D> deltaType)
public static <D extends ItemDelta> void removeItemDelta(Collection<? extends ItemDelta> deltas, ItemDelta deltaToRemove)
public ItemDelta<V,D> narrow(PrismObject<? extends Objectable> object)
public ItemDelta<V,D> narrow(PrismObject<? extends Objectable> object, Comparator<V> comparator)
public boolean isRedundant(PrismObject<? extends Objectable> object)
public boolean isRedundant(PrismObject<? extends Objectable> object, Comparator<V> comparator)
public void validate() throws SchemaException
SchemaException
public void validate(String contextDescription) throws SchemaException
SchemaException
public static void checkConsistence(Collection<? extends ItemDelta> deltas)
public static void checkConsistence(Collection<? extends ItemDelta> deltas, ConsistencyCheckScope scope)
public static void checkConsistence(Collection<? extends ItemDelta> deltas, boolean requireDefinition, boolean prohibitRaw, ConsistencyCheckScope scope)
public void checkConsistence()
public void checkConsistence(ConsistencyCheckScope scope)
public void checkConsistence(boolean requireDefinition, boolean prohibitRaw, ConsistencyCheckScope scope)
public void distributeReplace(Collection<V> existingValues)
public void merge(ItemDelta<V,D> deltaToMerge)
public void simplify()
public static void applyTo(Collection<? extends ItemDelta> deltas, PrismContainer propertyContainer) throws SchemaException
SchemaException
public static void applyToMatchingPath(Collection<? extends ItemDelta> deltas, PrismContainer propertyContainer) throws SchemaException
SchemaException
public void applyTo(PrismContainerValue containerValue) throws SchemaException
SchemaException
public void applyTo(Item item) throws SchemaException
SchemaException
public void applyToMatchingPath(Item item) throws SchemaException
SchemaException
public boolean isApplicableTo(Item item)
protected abstract boolean isApplicableToType(Item item)
public static void accept(Collection<? extends ItemDelta> modifications, Visitor visitor, ItemPath path, boolean recursive)
public Item<V,D> getItemNew() throws SchemaException
SchemaException
public Item<V,D> getItemNew(Item<V,D> itemOld) throws SchemaException
SchemaException
public Item<V,D> getItemNewMatchingPath(Item<V,D> itemOld) throws SchemaException
SchemaException
public boolean contains(ItemDelta<V,D> other)
public static <D extends ItemDelta<?,?>> Collection<D> cloneCollection(Collection<D> orig)
@Deprecated public static <IV extends PrismValue,ID extends ItemDefinition> PrismValueDeltaSetTriple<IV> toDeltaSetTriple(Item<IV,ID> item, ItemDelta<IV,ID> delta, boolean oldValuesValid, boolean newValuesValid)
public static <IV extends PrismValue,ID extends ItemDefinition> PrismValueDeltaSetTriple<IV> toDeltaSetTriple(Item<IV,ID> item, ItemDelta<IV,ID> delta)
public PrismValueDeltaSetTriple<V> toDeltaSetTriple()
public PrismValueDeltaSetTriple<V> toDeltaSetTriple(Item<V,D> itemOld)
public void assertDefinitions(String sourceDescription) throws SchemaException
SchemaException
public void assertDefinitions(boolean tolarateRawValues, String sourceDescription) throws SchemaException
SchemaException
public boolean isRaw()
public void revive(PrismContext prismContext) throws SchemaException
SchemaException
public void applyDefinition(D itemDefinition, boolean force) throws SchemaException
SchemaException
public boolean equivalent(ItemDelta other)
public static boolean hasEquivalent(Collection<? extends ItemDelta> col, ItemDelta delta)
public String debugDump()
DebugDumpable
debugDump
in interface DebugDumpable
public String debugDump(int indent)
debugDump
in interface DebugDumpable
protected void dumpValues(StringBuilder sb, String label, Collection<V> values, int indent)
public static void addAll(Collection<? extends ItemDelta> modifications, Collection<? extends ItemDelta> deltasToAdd)
public static void merge(Collection<? extends ItemDelta> modifications, ItemDelta delta)
public static void mergeAll(Collection<? extends ItemDelta> modifications, Collection<? extends ItemDelta> deltasToMerge)
public void addToReplaceDelta()
Copyright © 2016 evolveum. All rights reserved.