Package com.evolveum.midpoint.prism.util
Class ItemDeltaItem<V extends PrismValue,D extends ItemDefinition<?>>
java.lang.Object
com.evolveum.midpoint.prism.util.ItemDeltaItem<V,D>
- Type Parameters:
V
- type of value that the item holdsD
- type of definition of the item
- All Implemented Interfaces:
AbstractItemDeltaItem<D>
,DebugDumpable
,Serializable
public class ItemDeltaItem<V extends PrismValue,D extends ItemDefinition<?>>
extends Object
implements AbstractItemDeltaItem<D>
A class defining old item state (before change), delta (change) and new item state (after change). This is a useful
class used to describe how the item has changed or is going to be changed without the need to re-apply the delta
several times. The delta can be applied once, and then all the rest of the code will have all the data
available. This is mostly just a convenience class that groups those three things together.
There is only a very little logic on top of that.
- Author:
- Radovan Semancik
- See Also:
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Constructor Summary
ModifierConstructorDescriptionItemDeltaItem
(@NotNull Item<V, D> item) ItemDeltaItem
(@Nullable Item<V, D> itemOld, @Nullable ItemDelta<V, D> delta, @Nullable Item<V, D> itemNew, D explicitDefinition) protected
ItemDeltaItem
(@Nullable Item<V, D> itemOld, @Nullable ItemDelta<V, D> delta, @Nullable Item<V, D> itemNew, D definition, @NotNull ItemPath resolvePath, @Nullable ItemPath residualPath, @Nullable Collection<? extends ItemDelta<?, ?>> subItemDeltas) For internal use (e.g., cloning); we do not do any checks here.ItemDeltaItem
(@Nullable Item<V, D> item, D definition) ItemDeltaItem
(@Nullable Item<V, D> item, D definition, @NotNull ItemPath resolvePath, @Nullable Collection<? extends ItemDelta<?, ?>> subItemDeltas) protected
ItemDeltaItem
(D definition) ForObjectDeltaObject
. -
Method Summary
Modifier and TypeMethodDescriptionclone()
debugDump
(int indent) protected static <V extends PrismValue,
D extends ItemDefinition<?>>
DdetermineDefinition
(Item<V, D> itemOld, ItemDelta<V, D> delta, Item<V, D> itemNew, D explicitDefinition) boolean
<IV extends PrismValue,
ID extends ItemDefinition<?>>
ItemDeltaItem<IV,ID> findIdi
(@NotNull ItemPath path, @Nullable DefinitionResolver<D, ID> additionalDefinitionResolver) As #findIdi(ItemPath) but with additional definition resolver that provides definitions for sub-items found.static <V extends PrismValue,
D extends ItemDefinition<?>>
ItemDeltaItem<V,D> Presumably for "value creation" delta.static ItemDeltaItem<?,
?> forUnchanged
(@NotNull Item<?, ?> item) The definition of the item/object in question.getDelta()
Returns new item that is a result of delta application.@NotNull ItemPath
getSingleValue
(boolean old) Collection<? extends ItemDelta<?,
?>> int
hashCode()
boolean
Is the item in question a prism container?boolean
isNull()
Is the IDI empty, i.e.boolean
Is the item in question a prism property?boolean
Is the item in question a structured property -Structured
? I.e.void
Recomputes the new state of the IDI.resolveStructuredProperty
(ItemPath resolvePath, PrismPropertyDefinition<X> outputDefinition) Assumes that this IDI represents structured propertytoString()
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.evolveum.midpoint.prism.util.AbstractItemDeltaItem
findIdi
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Constructor Details
-
ItemDeltaItem
protected ItemDeltaItem(@Nullable @Nullable Item<V, D> itemOld, @Nullable @Nullable ItemDelta<V, D> delta, @Nullable @Nullable Item<V, D> itemNew, @NotNull D definition, @NotNull @NotNull ItemPath resolvePath, @Nullable @Nullable ItemPath residualPath, @Nullable @Nullable Collection<? extends ItemDelta<?, ?>> subItemDeltas) For internal use (e.g., cloning); we do not do any checks here. -
ItemDeltaItem
ForObjectDeltaObject
. -
ItemDeltaItem
-
ItemDeltaItem
-
ItemDeltaItem
-
ItemDeltaItem
-
-
Method Details
-
forUnchanged
-
forDelta
public static <V extends PrismValue,D extends ItemDefinition<?>> ItemDeltaItem<V,D> forDelta(@NotNull @NotNull ItemDelta<V, D> delta) Presumably for "value creation" delta. The object must be recomputed after returning from the method. -
determineDefinition
@NotNull protected static <V extends PrismValue,D extends ItemDefinition<?>> D determineDefinition(Item<V, D> itemOld, ItemDelta<V, D> delta, Item<V, D> itemNew, D explicitDefinition) -
getItemOld
-
getDelta
-
getItemNew
Returns new item that is a result of delta application. May return null if there is no new item. 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. -
getAnyItem
-
getResidualPath
-
getResolvePath
-
getSubItemDeltas
-
isNull
public boolean isNull()Description copied from interface:AbstractItemDeltaItem
Is the IDI empty, i.e. is everything null? FIXME the implementation of this method may not be 100% precise. Should be reviewed.- Specified by:
isNull
in interfaceAbstractItemDeltaItem<V extends PrismValue>
-
getElementName
-
getDefinition
Description copied from interface:AbstractItemDeltaItem
The definition of the item/object in question.- Specified by:
getDefinition
in interfaceAbstractItemDeltaItem<V extends PrismValue>
-
recompute
Description copied from interface:AbstractItemDeltaItem
Recomputes the new state of the IDI.- Specified by:
recompute
in interfaceAbstractItemDeltaItem<V extends PrismValue>
- Throws:
SchemaException
-
findIdi
public <IV extends PrismValue,ID extends ItemDefinition<?>> ItemDeltaItem<IV,ID> findIdi(@NotNull @NotNull ItemPath path, @Nullable @Nullable DefinitionResolver<D, ID> additionalDefinitionResolver) throws SchemaExceptionDescription copied from interface:AbstractItemDeltaItem
As #findIdi(ItemPath) but with additional definition resolver that provides definitions for sub-items found.- Specified by:
findIdi
in interfaceAbstractItemDeltaItem<V extends PrismValue>
- Throws:
SchemaException
-
toDeltaSetTriple
- Throws:
SchemaException
-
isContainer
public boolean isContainer()Description copied from interface:AbstractItemDeltaItem
Is the item in question a prism container?- Specified by:
isContainer
in interfaceAbstractItemDeltaItem<V extends PrismValue>
-
isProperty
public boolean isProperty()Description copied from interface:AbstractItemDeltaItem
Is the item in question a prism property?- Specified by:
isProperty
in interfaceAbstractItemDeltaItem<V extends PrismValue>
-
isStructuredProperty
public boolean isStructuredProperty()Description copied from interface:AbstractItemDeltaItem
Is the item in question a structured property -Structured
? I.e. a prism property that has visible components. (E.g., aPolyString
.) SeeresolveStructuredProperty(ItemPath, PrismPropertyDefinition)
.- Specified by:
isStructuredProperty
in interfaceAbstractItemDeltaItem<V extends PrismValue>
-
resolveStructuredProperty
public <X> ItemDeltaItem<PrismPropertyValue<X>,PrismPropertyDefinition<X>> resolveStructuredProperty(ItemPath resolvePath, PrismPropertyDefinition<X> outputDefinition) Assumes that this IDI represents structured property -
clone
-
equals
-
hashCode
public int hashCode() -
toString
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
getSingleValue
-