public abstract class ItemDelta<V extends PrismValue> extends Object implements Itemable, Dumpable, DebugDumpable, Visitable, PathVisitable, Serializable
Modifier and Type | Field and Description |
---|---|
protected ItemDefinition |
definition |
protected QName |
name
Name of the property
|
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
Constructor and Description |
---|
ItemDelta(ItemDefinition itemDefinition) |
ItemDelta(ItemPath path,
ItemDefinition itemDefinition) |
ItemDelta(ItemPath parentPath,
QName name,
ItemDefinition itemDefinition) |
ItemDelta(QName name,
ItemDefinition itemDefinition) |
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,
ItemPath path,
boolean recursive) |
boolean |
addsAnyValue() |
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) |
static void |
applyDefinition(Collection<? extends ItemDelta> deltas,
PrismObjectDefinition definition) |
void |
applyDefinition(ItemDefinition definition) |
void |
applyDefinition(ItemDefinition itemDefinition,
boolean force) |
static void |
applyTo(Collection<? extends ItemDelta> deltas,
PrismContainer propertyContainer) |
void |
applyTo(Item item)
Apply this delta (path) to a property.
|
void |
applyTo(PrismContainer<?> propertyContainer)
Apply this delta (path) to a property container.
|
void |
applyTo(PrismContainerValue<?> propertyContainerVal)
Apply this delta (path) to a property container.
|
void |
assertDefinitions(boolean tolarateRawValues,
String sourceDescription) |
void |
assertDefinitions(String sourceDescription) |
void |
checkConsistence() |
void |
checkConsistence(boolean requireDefinition,
boolean prohibitRaw) |
static void |
checkConsistence(Collection<? extends ItemDelta> deltas) |
static void |
checkConsistence(Collection<? extends ItemDelta> deltas,
boolean requireDefinition,
boolean prohibitRaw) |
void |
clear() |
void |
clearValuesToAdd() |
void |
clearValuesToDelete() |
void |
clearValuesToReplace() |
abstract ItemDelta<V> |
clone() |
<I extends Item> |
computeChangedItem(I oldItem) |
boolean |
contains(ItemDelta<V> other)
Returns true if the other delta is a complete subset of this delta.
|
protected void |
copyValues(ItemDelta<V> 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.
|
String |
dump()
Show the content of the object intended for diagnostics by developer.
|
protected void |
dumpValues(StringBuilder sb,
String label,
Collection<V> values,
int indent) |
boolean |
equals(Object obj) |
static <X extends Containerable> |
findContainerDelta(Collection<? extends ItemDelta> deltas,
ItemPath propertyPath) |
static <X extends Containerable> |
findContainerDelta(Collection<? extends ItemDelta> deltas,
QName name) |
static <D extends ItemDelta> |
findItemDelta(Collection<? extends ItemDelta> deltas,
ItemPath propertyPath,
Class<D> 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 PropertyDelta |
findPropertyDelta(Collection<? extends ItemDelta> deltas,
ItemPath propertyPath) |
static PropertyDelta |
findPropertyDelta(Collection<? extends ItemDelta> deltas,
ItemPath parentPath,
QName propertyName) |
static PropertyDelta |
findPropertyDelta(Collection<? extends ItemDelta> deltas,
QName propertyName) |
static ReferenceDelta |
findReferenceModification(Collection<? extends ItemDelta> deltas,
QName itemName) |
V |
getAnyValue() |
ItemDefinition |
getDefinition() |
abstract Class<? extends Item> |
getItemClass() |
Item<V> |
getItemNew()
Returns the "new" state of the property - the state that would be after
the delta is applied.
|
Item<V> |
getItemNew(Item<V> itemOld)
Returns the "new" state of the property - the state that would be after
the delta is applied.
|
QName |
getName() |
ItemPath |
getParentPath() |
ItemPath |
getPath() |
PrismContext |
getPrismContext() |
Collection<V> |
getValuesToAdd() |
Collection<V> |
getValuesToDelete() |
Collection<V> |
getValuesToReplace() |
boolean |
hasCompleteDefinition() |
int |
hashCode() |
boolean |
isAdd() |
boolean |
isDelete() |
boolean |
isEmpty() |
boolean |
isRaw() |
boolean |
isReplace() |
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) |
void |
merge(ItemDelta<V> deltaToMerge)
Merge specified delta to this delta.
|
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> |
narrow(PrismObject<? extends Objectable> object)
Filters out all delta values that are meaningless to apply.
|
void |
normalize() |
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 |
revive(PrismContext prismContext) |
void |
setDefinition(ItemDefinition definition) |
void |
setName(QName name) |
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 <T extends PrismValue> |
toDeltaSetTriple(Item<T> item,
ItemDelta<T> delta) |
static <T extends PrismValue> |
toDeltaSetTriple(Item<T> item,
ItemDelta<T> delta,
boolean oldValuesValid,
boolean newValuesValid)
Deprecated.
|
PrismValueDeltaSetTriple<V> |
toDeltaSetTriple(Item<V> itemOld) |
String |
toString() |
void |
validate() |
void |
validate(String contextDescription) |
protected QName name
protected ItemPath parentPath
protected ItemDefinition definition
protected Collection<V extends PrismValue> valuesToReplace
protected Collection<V extends PrismValue> valuesToAdd
protected Collection<V extends PrismValue> valuesToDelete
public ItemDelta(ItemDefinition itemDefinition)
public ItemDelta(QName name, ItemDefinition itemDefinition)
public ItemDelta(ItemPath parentPath, QName name, ItemDefinition itemDefinition)
public ItemDelta(ItemPath path, ItemDefinition itemDefinition)
public void setName(QName name)
public ItemPath getParentPath()
public void setParentPath(ItemPath parentPath)
public ItemDefinition getDefinition()
getDefinition
in interface Itemable
public void setDefinition(ItemDefinition definition)
public void accept(Visitor visitor, ItemPath path, boolean recursive)
accept
in interface PathVisitable
public void applyDefinition(ItemDefinition 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)
public void mergeValuesToDelete(Collection<V> newValues)
public void mergeValuesToDelete(V[] newValues)
public void mergeValueToDelete(V newValue)
public void resetValuesToAdd()
public void setValuesToReplace(Collection<V> newValues)
public void setValuesToReplace(V... newValues)
public void setValueToReplace()
public void setValueToReplace(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 boolean addsAnyValue()
public void normalize()
public boolean isReplace()
public boolean isAdd()
public boolean isDelete()
public void clear()
public static PropertyDelta findPropertyDelta(Collection<? extends ItemDelta> deltas, QName propertyName)
public static PropertyDelta findPropertyDelta(Collection<? extends ItemDelta> deltas, ItemPath parentPath, QName propertyName)
public static PropertyDelta 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 <D extends ItemDelta> D findItemDelta(Collection<? extends ItemDelta> deltas, ItemPath propertyPath, Class<D> 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 ItemDelta<V> narrow(PrismObject<? extends Objectable> object)
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, boolean requireDefinition, boolean prohibitRaw)
public void checkConsistence()
public void checkConsistence(boolean requireDefinition, boolean prohibitRaw)
public void distributeReplace(Collection<V> existingValues)
public void merge(ItemDelta<V> deltaToMerge)
public void simplify()
public void applyTo(PrismContainer<?> propertyContainer) throws SchemaException
SchemaException
public static void applyTo(Collection<? extends ItemDelta> deltas, PrismContainer propertyContainer) throws SchemaException
SchemaException
public void applyTo(PrismContainerValue<?> propertyContainerVal) throws SchemaException
SchemaException
public void applyTo(Item item) throws SchemaException
SchemaException
public static void accept(Collection<? extends ItemDelta> modifications, Visitor visitor, ItemPath path, boolean recursive)
public <I extends Item> I computeChangedItem(I oldItem) throws SchemaException
SchemaException
public Item<V> getItemNew() throws SchemaException
SchemaException
public Item<V> getItemNew(Item<V> itemOld) throws SchemaException
SchemaException
public boolean contains(ItemDelta<V> other)
@Deprecated public static <T extends PrismValue> PrismValueDeltaSetTriple<T> toDeltaSetTriple(Item<T> item, ItemDelta<T> delta, boolean oldValuesValid, boolean newValuesValid)
public static <T extends PrismValue> PrismValueDeltaSetTriple<T> toDeltaSetTriple(Item<T> item, ItemDelta<T> delta)
public PrismValueDeltaSetTriple<V> toDeltaSetTriple()
public PrismValueDeltaSetTriple<V> toDeltaSetTriple(Item<V> 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)
public void applyDefinition(ItemDefinition itemDefinition, boolean force) throws SchemaException
SchemaException
public String debugDump()
DebugDumpable
debugDump
in interface DebugDumpable
public String debugDump(int indent)
debugDump
in interface DebugDumpable
public String dump()
Dumpable
protected void dumpValues(StringBuilder sb, String label, Collection<V> values, int indent)
Copyright © 2013 evolveum. All rights reserved.