Class ValueMetadataAdapter
- java.lang.Object
-
- com.evolveum.midpoint.prism.impl.metadata.ValueMetadataAdapter
-
- All Implemented Interfaces:
Freezable
,Item<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
,Itemable
,ParentVisitable
,PathVisitable
,PrismContainer<Containerable>
,PrismContainerable<Containerable>
,PrismContextSensitive
,Revivable
,ValueMetadata
,Visitable
,DebugDumpable
,ShortDumpable
,Serializable
@Experimental public class ValueMetadataAdapter extends Object implements ValueMetadata
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(Visitor visitor)
void
accept(Visitor visitor, ItemPath path, boolean recursive)
void
acceptParentVisitor(@NotNull Visitor visitor)
Accepts a visitor that visits each item/value on the way to the structure root.boolean
add(@NotNull PrismContainerValue<Containerable> newValue)
Adds a given value, overwriting existing one.boolean
add(@NotNull PrismContainerValue<Containerable> newValue, @NotNull EquivalenceStrategy strategy)
Adds a value, overwriting existing one(s).void
add(Item<?,?> item)
Convenience method.boolean
addAll(Collection<PrismContainerValue<Containerable>> newValues)
Adds given values, with the same semantics as repeated add(..) calls.boolean
addAll(Collection<PrismContainerValue<Containerable>> newValues, @NotNull EquivalenceStrategy strategy)
Adds given values, with the same semantics as repeated add(..) calls.void
addIgnoringEquivalents(@NotNull PrismContainerValue<Containerable> newValue)
Adds a value, not looking for equivalent values.void
addRespectingMetadataAndCloning(PrismContainerValue<Containerable> value, @NotNull EquivalenceStrategy strategy, EquivalenceStrategy metadataEquivalenceStrategy)
Adds a value, respecting the metadata.void
applyDefinition(PrismContainerDefinition<Containerable> definition)
void
applyDefinition(PrismContainerDefinition<Containerable> definition, boolean force)
void
assertDefinitions()
void
assertDefinitions(boolean tolerateRawValues, Supplier<String> sourceDescriptionSupplier)
void
assertDefinitions(Supplier<String> sourceDescriptionSupplier)
boolean
canRepresent(@NotNull Class<?> compileTimeClass)
Returns true if values of this container can be represented as specified compile-time class.boolean
canRepresent(QName type)
Returns true if values of this container can be presented as specified type (from compile-time or runtime schema).void
checkConsistence()
void
checkConsistence(boolean requireDefinitions, boolean prohibitRaw)
void
checkConsistence(boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
void
checkConsistence(boolean requireDefinitions, ConsistencyCheckScope scope)
void
checkConsistence(ConsistencyCheckScope scope)
void
checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
void
checkImmutable()
void
checkMutable()
void
clear()
Removes all values from the item.ValueMetadata
clone()
Literal clone.static <T extends Item<?,?>>
Collection<T>cloneCollection(Collection<T> items)
PrismContainer<Containerable>
cloneComplex(CloneStrategy strategy)
Complex clone with different cloning strategies.boolean
contains(@NotNull PrismContainerValue<Containerable> value)
boolean
contains(@NotNull PrismContainerValue<Containerable> value, @NotNull EquivalenceStrategy strategy)
boolean
containsItem(ItemPath itemPath, boolean acceptEmptyItem)
ContainerDelta<Containerable>
createDelta()
Creates specific subclass of ItemDelta appropriate for type of item that this definition represents (e.g.ContainerDelta<Containerable>
createDelta(ItemPath path)
PrismContainer<Containerable>
createImmutableClone()
PrismContainerValue<Containerable>
createNewValue()
static <V extends PrismContainerValue>
voidcreateParentIfNeeded(V value, ItemDefinition definition)
String
debugDump(int indent)
PrismContainerDefinition<Containerable>
deepCloneDefinition(@NotNull DeepCloneOperation operation)
ItemDelta<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
diff(Item<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>> other)
Computes a difference (delta) with the specified item using DEFAULT_FOR_DELTA_APPLICATION (REAL_VALUE_CONSIDER_DIFFERENT_IDS) equivalence strategy.ItemDelta<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
diff(Item<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>> other, @NotNull ParameterizedEquivalenceStrategy strategy)
Computes a difference (delta) with the specified item using given equivalence strategy.ContainerDelta<Containerable>
diff(PrismContainer<Containerable> other)
ContainerDelta<Containerable>
diff(PrismContainer<Containerable> other, ParameterizedEquivalenceStrategy strategy)
List<? extends ItemDelta>
diffModifications(PrismContainer<Containerable> other, ParameterizedEquivalenceStrategy strategy)
boolean
equals(Object obj)
Compares this item to the specified object under DEFAULT_FOR_EQUALS (DATA) strategy.boolean
equals(Object obj, @NotNull EquivalenceStrategy equivalenceStrategy)
Compares this item to the specified object under given strategy.boolean
equals(Object obj, @NotNull ParameterizedEquivalenceStrategy equivalenceStrategy)
Compares this item to the specified object under given strategy.boolean
equivalent(Object obj)
This method ignores some part of the object during comparison (e.g.Object
find(ItemPath path)
Returns object (Item or PrismValue) pointed to by the given path.<T extends Containerable>
PrismContainer<T>findContainer(ItemPath path)
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>>
IfindCreateItem(ItemPath itemPath, Class<I> type, ID itemDefinition, boolean create)
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>>
IfindCreateItem(QName itemQName, Class<I> type, boolean create)
<IV extends PrismValue,ID extends ItemDefinition>
Item<IV,ID>findItem(ItemPath path)
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>>
IfindItem(ItemPath path, Class<I> type)
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>>
IfindItem(QName itemQName, Class<I> type)
<T extends Containerable>
PrismContainer<T>findOrCreateContainer(ItemPath containerPath)
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>>
IfindOrCreateItem(ItemPath containerPath, Class<I> type)
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>>
IfindOrCreateItem(ItemPath containerPath, Class<I> type, ID definition)
<T> PrismProperty<T>
findOrCreateProperty(ItemPath propertyPath)
PrismReference
findOrCreateReference(ItemPath propertyPath)
<IV extends PrismValue,ID extends ItemDefinition>
PartiallyResolvedItem<IV,ID>findPartial(ItemPath path)
<T> PrismProperty<T>
findProperty(ItemPath path)
PrismReference
findReference(ItemPath path)
PrismContainerValue<Containerable>
findValue(long id)
PrismContainerValue<Containerable>
findValue(@NotNull PrismContainerValue<Containerable> value, @NotNull EquivalenceStrategy strategy)
PrismContainerValue<Containerable>
findValue(PrismContainerValue<Containerable> value, @NotNull Comparator<PrismContainerValue<Containerable>> comparator)
void
freeze()
static @NotNull Collection<PrismValue>
getAllValues(Item<?,?> item, ItemPath path)
@NotNull Collection<PrismValue>
getAllValues(ItemPath path)
PrismContainerValue<Containerable>
getAnyValue()
Returns any of the values.PrismContainerValue<Containerable>
getAnyValue(@NotNull ValueSelector<PrismContainerValue<Containerable>> selector)
Returns a value matching given selector (or null if none exists).Collection<PrismContainerValue<Containerable>>
getClonedValues()
@Nullable Class<Containerable>
getCompileTimeClass()
Returns the static type of data represented by values of this container, if known and applicable.ComplexTypeDefinition
getComplexTypeDefinition()
PrismContainerDefinition<Containerable>
getDefinition()
Returns applicable definition.String
getDisplayName()
Returns a display name for the item.ItemName
getElementName()
Returns the name of the item.String
getHelp()
Returns help message defined for the item.Long
getHighestId()
@Nullable PrismContainerValue<?>
getParent()
Returns the parent of this item (if exists).@NotNull ItemPath
getPath()
Returns the path of this item (sequence of names from the "root" container or similar object to this item).PrismContext
getPrismContext()
PrismContext
getPrismContextLocal()
<T> T
getPropertyRealValue(ItemPath propertyPath, Class<T> type)
@NotNull Containerable
getRealValue()
Returns the "real value" (content) of this item: - value contained in PrismPropertyValue - Referencable in PrismReferenceValue - Containerable in PrismContainerValue - Objectable in PrismObjectValue Note that the real value can contain operational items.<X> X
getRealValue(Class<X> type)
Type override, also for compatibility.@NotNull Collection<Containerable>
getRealValues()
Returns (potentially empty) collection of "real values".<X> X[]
getRealValuesArray(Class<X> type)
Type override, also for compatibility.@NotNull Collection<Object>
getRealValuesOrRawTypes(PrismContext prismContext)
@NotNull Map<String,Object>
getUserData()
Returns the "user data", a map that allows attaching arbitrary named data to this item.<T> T
getUserData(String key)
Returns the user data for the given key (name).@NotNull PrismContainerValue<Containerable>
getValue()
Returns the value, if there is only one.PrismContainerValue<Containerable>
getValue(Long id)
@NotNull List<PrismContainerValue<Containerable>>
getValues()
Returns the values for this item.static <V extends PrismValue>
@NotNull Collection<V>getValues(Item<V,?> item)
boolean
hasCompleteDefinition()
Returns true if this item and all contained items have definitions.int
hashCode()
Computes hash code to be used under DEFAULT_FOR_EQUALS (currently DATA) equivalence strategy.int
hashCode(@NotNull EquivalenceStrategy equivalenceStrategy)
Computes hash code to be used under given equivalence strategy.int
hashCode(@NotNull ParameterizedEquivalenceStrategy equivalenceStrategy)
Computes hash code to be used under given equivalence strategy.boolean
hasNoValues()
static boolean
hasNoValues(Item<?,?> item)
boolean
hasRaw()
Returns true is at least one of the values is raw.static ValueMetadata
holding(@NotNull PrismContainer<?> value)
boolean
isEmpty()
Normally the same asItem.hasNoValues()
.boolean
isImmutable()
boolean
isIncomplete()
Flag that indicates incomplete item.boolean
isOperational()
Returns true if this item is metadata item that should be ignored for metadata-insensitive comparisons and hashCode functions.boolean
isRaw()
Returns true is all the values are raw.boolean
isSingleValue()
Returns true if the item contains 0 or 1 values and (by definition) is not multivalued.void
merge(Item<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>> otherItem)
Merge all the values of other item to this item.void
mergeValue(PrismContainerValue<Containerable> otherValue)
void
mergeValues(PrismContainer<Containerable> other)
void
mergeValues(Collection<PrismContainerValue<Containerable>> otherValues)
static <V extends Containerable>
PrismContainer<V>newInstance(PrismContext prismContext, QName type)
void
normalize()
Currently doing nothing.void
recomputeAllValues()
Re-apply PolyString (and possible other) normalizations to the object.void
remove(Item<?,?> item)
Convenience method.boolean
remove(PrismContainerValue<Containerable> value)
Removes values equivalent to given value from the item.boolean
remove(PrismContainerValue<Containerable> value, @NotNull EquivalenceStrategy strategy)
Removes values equivalent to given value from the item; under specified equivalence strategy OR when values represent the same value via "representsSameValue(.., lax=false)" method.boolean
removeAll(Collection<PrismContainerValue<Containerable>> values, @NotNull EquivalenceStrategy strategy)
Removes all given values from the item.void
removeContainer(ItemPath path)
<IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>>
voidremoveItem(ItemPath path, Class<I> itemType)
void
removeProperty(ItemPath path)
void
removeReference(ItemPath path)
void
removeRespectingMetadata(PrismContainerValue<Containerable> value, @NotNull EquivalenceStrategy strategy, EquivalenceStrategy metadataEquivalenceStrategy)
Removes values equivalent to given value from the item; under specified equivalence strategy OR when values represent the same value via "representsSameValue(.., lax=false)" method.void
replace(PrismContainerValue<Containerable> newValue)
Replaces all values of the item by given value.void
replaceAll(Collection<PrismContainerValue<Containerable>> newValues, @NotNull EquivalenceStrategy strategy)
Replaces all values of the item by given values.static <T extends Item>
Collection<T>resetParentCollection(Collection<T> items)
Sets all parents to null.void
revive(PrismContext prismContext)
TODO: Is revive necessary if prism context is static? TODO document (if it's found to be necessary)<C extends Containerable>
voidsetContainerRealValue(QName containerName, C realValue)
void
setDefinition(PrismContainerDefinition<Containerable> definition)
Sets applicable property container definition.void
setElementName(QName elementName)
Sets the name of the item.void
setIncomplete(boolean incomplete)
Flags the item as incomplete.void
setParent(@Nullable PrismContainerValue<?> parentValue)
Sets the parent of this item.void
setPrismContext(PrismContext prismContext)
<T> void
setPropertyRealValue(QName propertyName, T realValue)
<T> void
setPropertyRealValues(QName propertyName, T... realValues)
void
setRealValue(Containerable value)
void
setUserData(String key, Object value)
Sets the user data for the given key (name).void
setValue(@NotNull PrismContainerValue<Containerable> value)
void
shortDump(StringBuilder sb)
Show the content of the object intended for diagnostics.void
trim()
Remove all empty valuesvoid
trimDefinitionTree(Collection<? extends ItemPath> alwaysKeep)
Optimizes (trims) definition tree by removing any definitions not corresponding to items in this container.-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.prism.Item
copy, filterValues, filterYields, hasAnyValue, isSingleValueByDefinition, removeIf, size, valuesStream
-
Methods inherited from interface com.evolveum.midpoint.util.ShortDumpable
shortDump, shortDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.prism.ValueMetadata
addMetadataValue
-
-
-
-
Method Detail
-
holding
public static ValueMetadata holding(@NotNull @NotNull PrismContainer<?> value)
-
getPrismContext
public PrismContext getPrismContext()
- Specified by:
getPrismContext
in interfacePrismContextSensitive
-
clone
public ValueMetadata clone()
Description copied from interface:Item
Literal clone.- Specified by:
clone
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Specified by:
clone
in interfacePrismContainer<Containerable>
- Specified by:
clone
in interfaceValueMetadata
- Overrides:
clone
in classObject
-
shortDump
public void shortDump(StringBuilder sb)
Description copied from interface:ShortDumpable
Show the content of the object intended for diagnostics. This method is supposed to append a compact, human-readable output in a single line. Unlike toString() method, there is no requirement to identify the actual class or type of the object. It is assumed that the class/type will be obvious from the context in which the output is used.- Specified by:
shortDump
in interfaceShortDumpable
- Parameters:
sb
- StringBuilder to which to a compact one-line content of the object intended for diagnostics by system administrator should be appended.
-
getCompileTimeClass
@Nullable public @Nullable Class<Containerable> getCompileTimeClass()
Description copied from interface:PrismContainer
Returns the static type of data represented by values of this container, if known and applicable. (There are containers that are purely dynamic, i.e. without any compile time class.)- Specified by:
getCompileTimeClass
in interfacePrismContainer<Containerable>
- Specified by:
getCompileTimeClass
in interfacePrismContainerable<Containerable>
-
canRepresent
public boolean canRepresent(@NotNull @NotNull Class<?> compileTimeClass)
Description copied from interface:PrismContainer
Returns true if values of this container can be represented as specified compile-time class. For example, PrismContainer of AbstractRoleType has: - canRepresent(AbstractRoleType.class) = true - canRepresent(FocusType.class) = true - canRepresent(ObjectType.class) = true - canRepresent(TaskType.class) = false - canRepresent(RoleType.class) = false- Specified by:
canRepresent
in interfacePrismContainer<Containerable>
-
canRepresent
public boolean canRepresent(QName type)
Description copied from interface:PrismContainer
Returns true if values of this container can be presented as specified type (from compile-time or runtime schema). In particular, returns true if type of this container or any of its supertypes match given type.- Specified by:
canRepresent
in interfacePrismContainer<Containerable>
-
getRealValues
@NotNull public @NotNull Collection<Containerable> getRealValues()
Description copied from interface:Item
Returns (potentially empty) collection of "real values".- Specified by:
getRealValues
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Specified by:
getRealValues
in interfacePrismContainer<Containerable>
- Returns:
- List of current values. The list itself is freely modifiable - it is independent on the list of values in this container. However, values themselves are directly linked to the PCVs.
-
getRealValue
@NotNull public @NotNull Containerable getRealValue()
Description copied from interface:Item
Returns the "real value" (content) of this item: - value contained in PrismPropertyValue - Referencable in PrismReferenceValue - Containerable in PrismContainerValue - Objectable in PrismObjectValue Note that the real value can contain operational items. It can also contain container IDs (although they are not considered to be part of the real value). It does not contain information about item element name nor other metadata like origin, definition, etc. (Although e.g. Containerable can be converted back into PrismContainerValue that can be used to retrieve this information.)- Specified by:
getRealValue
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Specified by:
getRealValue
in interfacePrismContainer<Containerable>
-
setRealValue
public void setRealValue(Containerable value) throws SchemaException
- Specified by:
setRealValue
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
setValue
public void setValue(@NotNull @NotNull PrismContainerValue<Containerable> value) throws SchemaException
- Specified by:
setValue
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
getValue
@NotNull public @NotNull PrismContainerValue<Containerable> getValue()
Description copied from interface:Item
Returns the value, if there is only one. Throws exception if there are more values. If there is no value, this method either: - returns null (for properties) - throws an exception (for items that can hold multiple values) - creates an empty value (for containers and references). TODO think again whether getOrCreateValue would not be better- Specified by:
getValue
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Specified by:
getValue
in interfacePrismContainer<Containerable>
-
getValue
public PrismContainerValue<Containerable> getValue(Long id)
- Specified by:
getValue
in interfacePrismContainer<Containerable>
-
setPropertyRealValue
public <T> void setPropertyRealValue(QName propertyName, T realValue) throws SchemaException
- Specified by:
setPropertyRealValue
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
setContainerRealValue
public <C extends Containerable> void setContainerRealValue(QName containerName, C realValue) throws SchemaException
- Specified by:
setContainerRealValue
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
setPropertyRealValues
public <T> void setPropertyRealValues(QName propertyName, T... realValues) throws SchemaException
- Specified by:
setPropertyRealValues
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
getPropertyRealValue
public <T> T getPropertyRealValue(ItemPath propertyPath, Class<T> type)
- Specified by:
getPropertyRealValue
in interfacePrismContainer<Containerable>
-
add
public void add(Item<?,?> item) throws SchemaException
Description copied from interface:PrismContainer
Convenience method. Works only on single-valued containers.- Specified by:
add
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
createNewValue
public PrismContainerValue<Containerable> createNewValue()
- Specified by:
createNewValue
in interfacePrismContainer<Containerable>
-
mergeValues
public void mergeValues(PrismContainer<Containerable> other) throws SchemaException
- Specified by:
mergeValues
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
mergeValues
public void mergeValues(Collection<PrismContainerValue<Containerable>> otherValues) throws SchemaException
- Specified by:
mergeValues
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
mergeValue
public void mergeValue(PrismContainerValue<Containerable> otherValue) throws SchemaException
- Specified by:
mergeValue
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
trim
public void trim()
Description copied from interface:PrismContainer
Remove all empty values- Specified by:
trim
in interfacePrismContainer<Containerable>
-
setDefinition
public void setDefinition(PrismContainerDefinition<Containerable> definition)
Description copied from interface:PrismContainer
Sets applicable property container definition.- Specified by:
setDefinition
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Specified by:
setDefinition
in interfacePrismContainer<Containerable>
- Parameters:
definition
- the definition to set
-
applyDefinition
public void applyDefinition(PrismContainerDefinition<Containerable> definition) throws SchemaException
- Specified by:
applyDefinition
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Specified by:
applyDefinition
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
findItem
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findItem(QName itemQName, Class<I> type)
- Specified by:
findItem
in interfacePrismContainer<Containerable>
-
findPartial
public <IV extends PrismValue,ID extends ItemDefinition> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path)
- Specified by:
findPartial
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Specified by:
findPartial
in interfacePrismContainer<Containerable>
-
findCreateItem
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findCreateItem(QName itemQName, Class<I> type, boolean create) throws SchemaException
- Specified by:
findCreateItem
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
findItem
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findItem(ItemPath path, Class<I> type)
- Specified by:
findItem
in interfacePrismContainer<Containerable>
-
findItem
public <IV extends PrismValue,ID extends ItemDefinition> Item<IV,ID> findItem(ItemPath path)
- Specified by:
findItem
in interfacePrismContainer<Containerable>
-
containsItem
public boolean containsItem(ItemPath itemPath, boolean acceptEmptyItem) throws SchemaException
- Specified by:
containsItem
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
findCreateItem
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findCreateItem(ItemPath itemPath, Class<I> type, ID itemDefinition, boolean create) throws SchemaException
- Specified by:
findCreateItem
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
findValue
public PrismContainerValue<Containerable> findValue(long id)
- Specified by:
findValue
in interfacePrismContainer<Containerable>
-
findContainer
public <T extends Containerable> PrismContainer<T> findContainer(ItemPath path)
- Specified by:
findContainer
in interfacePrismContainer<Containerable>
-
findProperty
public <T> PrismProperty<T> findProperty(ItemPath path)
- Specified by:
findProperty
in interfacePrismContainer<Containerable>
-
findReference
public PrismReference findReference(ItemPath path)
- Specified by:
findReference
in interfacePrismContainer<Containerable>
-
findOrCreateItem
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findOrCreateItem(ItemPath containerPath, Class<I> type) throws SchemaException
- Specified by:
findOrCreateItem
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
findOrCreateItem
public <IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findOrCreateItem(ItemPath containerPath, Class<I> type, ID definition) throws SchemaException
- Specified by:
findOrCreateItem
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
findOrCreateContainer
public <T extends Containerable> PrismContainer<T> findOrCreateContainer(ItemPath containerPath) throws SchemaException
- Specified by:
findOrCreateContainer
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
findOrCreateProperty
public <T> PrismProperty<T> findOrCreateProperty(ItemPath propertyPath) throws SchemaException
- Specified by:
findOrCreateProperty
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
findOrCreateReference
public PrismReference findOrCreateReference(ItemPath propertyPath) throws SchemaException
- Specified by:
findOrCreateReference
in interfacePrismContainer<Containerable>
- Throws:
SchemaException
-
remove
public void remove(Item<?,?> item)
Description copied from interface:PrismContainer
Convenience method. Works only on single-valued containers.- Specified by:
remove
in interfacePrismContainer<Containerable>
-
removeProperty
public void removeProperty(ItemPath path)
- Specified by:
removeProperty
in interfacePrismContainer<Containerable>
-
removeContainer
public void removeContainer(ItemPath path)
- Specified by:
removeContainer
in interfacePrismContainer<Containerable>
-
removeReference
public void removeReference(ItemPath path)
- Specified by:
removeReference
in interfacePrismContainer<Containerable>
-
removeItem
public <IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>> void removeItem(ItemPath path, Class<I> itemType)
- Specified by:
removeItem
in interfacePrismContainer<Containerable>
-
createDelta
public ContainerDelta<Containerable> createDelta()
Description copied from interface:Item
Creates specific subclass of ItemDelta appropriate for type of item that this definition represents (e.g. PropertyDelta, ContainerDelta, ...)- Specified by:
createDelta
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Specified by:
createDelta
in interfacePrismContainer<Containerable>
-
createDelta
public ContainerDelta<Containerable> createDelta(ItemPath path)
- Specified by:
createDelta
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Specified by:
createDelta
in interfacePrismContainer<Containerable>
-
diff
public ContainerDelta<Containerable> diff(PrismContainer<Containerable> other)
- Specified by:
diff
in interfacePrismContainer<Containerable>
-
diff
public ContainerDelta<Containerable> diff(PrismContainer<Containerable> other, ParameterizedEquivalenceStrategy strategy)
- Specified by:
diff
in interfacePrismContainer<Containerable>
-
diffModifications
public List<? extends ItemDelta> diffModifications(PrismContainer<Containerable> other, ParameterizedEquivalenceStrategy strategy)
- Specified by:
diffModifications
in interfacePrismContainer<Containerable>
-
createImmutableClone
public PrismContainer<Containerable> createImmutableClone()
- Specified by:
createImmutableClone
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Specified by:
createImmutableClone
in interfacePrismContainer<Containerable>
-
cloneComplex
public PrismContainer<Containerable> cloneComplex(CloneStrategy strategy)
Description copied from interface:Item
Complex clone with different cloning strategies.- Specified by:
cloneComplex
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Specified by:
cloneComplex
in interfacePrismContainer<Containerable>
- See Also:
CloneStrategy
-
deepCloneDefinition
public PrismContainerDefinition<Containerable> deepCloneDefinition(@NotNull @NotNull DeepCloneOperation operation)
- Specified by:
deepCloneDefinition
in interfacePrismContainer<Containerable>
-
accept
public void accept(Visitor visitor, ItemPath path, boolean recursive)
- Specified by:
accept
in interfacePathVisitable
- Specified by:
accept
in interfacePrismContainer<Containerable>
-
equivalent
public boolean equivalent(Object obj)
Description copied from interface:PrismContainer
This method ignores some part of the object during comparison (e.g. source demarcation in values) These methods compare the "meaningful" parts of the objects.- Specified by:
equivalent
in interfacePrismContainer<Containerable>
-
newInstance
public static <V extends Containerable> PrismContainer<V> newInstance(PrismContext prismContext, QName type) throws SchemaException
- Throws:
SchemaException
-
createParentIfNeeded
public static <V extends PrismContainerValue> void createParentIfNeeded(V value, ItemDefinition definition) throws SchemaException
- Throws:
SchemaException
-
trimDefinitionTree
public void trimDefinitionTree(Collection<? extends ItemPath> alwaysKeep)
Description copied from interface:PrismContainer
Optimizes (trims) definition tree by removing any definitions not corresponding to items in this container. Works recursively by sub-containers of this one. USE WITH CARE. Make sure the definitions are not shared by other objects!- Specified by:
trimDefinitionTree
in interfacePrismContainer<Containerable>
-
getDefinition
public PrismContainerDefinition<Containerable> getDefinition()
Description copied from interface:Item
Returns applicable definition.May return null if no definition is applicable or the definition is not known.
- Specified by:
getDefinition
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Specified by:
getDefinition
in interfaceItemable
- Specified by:
getDefinition
in interfacePrismContainer<Containerable>
- Specified by:
getDefinition
in interfacePrismContainerable<Containerable>
- Returns:
- applicable definition
-
hasCompleteDefinition
public boolean hasCompleteDefinition()
Description copied from interface:Item
Returns true if this item and all contained items have definitions.- Specified by:
hasCompleteDefinition
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
getElementName
public ItemName getElementName()
Description copied from interface:Item
Returns the name of the item.The name is a QName. It uniquely defines an item.
The name may be null, but such an item will not work.
The name is the QName of XML element in the XML representation.
- Specified by:
getElementName
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Specified by:
getElementName
in interfaceItemable
- Returns:
- item name TODO consider making element name obligatory
-
setElementName
public void setElementName(QName elementName)
Description copied from interface:Item
Sets the name of the item.The name is a QName. It uniquely defines an item.
The name may be null, but such an item will not work.
The name is the QName of XML element in the XML representation.
- Specified by:
setElementName
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Parameters:
elementName
- the name to set TODO consider removing this method
-
getDisplayName
public String getDisplayName()
Description copied from interface:Item
Returns a display name for the item.Returns null if the display name cannot be determined.
The display name is fetched from the definition. If no definition (schema) is available, the display name will not be returned.
- Specified by:
getDisplayName
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Returns:
- display name for the item
-
getHelp
public String getHelp()
Description copied from interface:Item
Returns help message defined for the item.Returns null if the help message cannot be determined.
The help message is fetched from the definition. If no definition (schema) is available, the help message will not be returned.
- Specified by:
getHelp
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Returns:
- help message for the item
-
isIncomplete
public boolean isIncomplete()
Description copied from interface:Item
Flag that indicates incomplete item. If set to true then the values in this item are not complete. If this flag is true then it can be assumed that the object that this item represents has at least one value. This is a method how to indicate that the item really has some values, but are not here. This may be used for variety of purposes. It may indicate that the account has a password, but the password value is not revealed. This may indicate that a user has a photo, but the photo was not requested and therefore is not returned. This may be used to indicate that only part of the attribute values were returned from the search. And so on.- Specified by:
isIncomplete
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
setIncomplete
public void setIncomplete(boolean incomplete)
Description copied from interface:Item
Flags the item as incomplete.- Specified by:
setIncomplete
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Parameters:
incomplete
- The new value- See Also:
FIXME: Should be package-visible to implementation
-
getParent
@Nullable public @Nullable PrismContainerValue<?> getParent()
Description copied from interface:Item
Returns the parent of this item (if exists). Currently this has to be a PrismContainerValue.- Specified by:
getParent
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Returns:
- The parent if exists
-
setParent
public void setParent(@Nullable @Nullable PrismContainerValue<?> parentValue)
Description copied from interface:Item
Sets the parent of this item.- Specified by:
setParent
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Parameters:
parentValue
- The new parent
-
getPath
@NotNull public @NotNull ItemPath getPath()
Description copied from interface:Item
Returns the path of this item (sequence of names from the "root" container or similar object to this item). Note that if the containing object is a delta (usually a container delta), then the path- Specified by:
getPath
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Specified by:
getPath
in interfaceItemable
- Returns:
- the path
-
getUserData
@NotNull public @NotNull Map<String,Object> getUserData()
Description copied from interface:Item
Returns the "user data", a map that allows attaching arbitrary named data to this item.- Specified by:
getUserData
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Returns:
- the user data map
-
getUserData
public <T> T getUserData(String key)
Description copied from interface:Item
Returns the user data for the given key (name).- Specified by:
getUserData
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
setUserData
public void setUserData(String key, Object value)
Description copied from interface:Item
Sets the user data for the given key (name).- Specified by:
setUserData
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
getValues
@NotNull public @NotNull List<PrismContainerValue<Containerable>> getValues()
Description copied from interface:Item
Returns the values for this item. Although the ordering of this values is not important, and each value should be present at most once, we currently return them as a list instead of a set. TODO reconsider this- Specified by:
getValues
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
getAnyValue
public PrismContainerValue<Containerable> getAnyValue()
Description copied from interface:Item
Returns any of the values. Usually called when we are quite confident that there is only a single value; or we don't care which of the values we get. Does not create values if there are none.- Specified by:
getAnyValue
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
getAnyValue
public PrismContainerValue<Containerable> getAnyValue(@NotNull @NotNull ValueSelector<PrismContainerValue<Containerable>> selector)
Description copied from interface:Item
Returns a value matching given selector (or null if none exists).- Specified by:
getAnyValue
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
getRealValue
public <X> X getRealValue(Class<X> type)
Description copied from interface:Item
Type override, also for compatibility.- Specified by:
getRealValue
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
getRealValuesArray
public <X> X[] getRealValuesArray(Class<X> type)
Description copied from interface:Item
Type override, also for compatibility.- Specified by:
getRealValuesArray
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
getRealValuesOrRawTypes
@Experimental @NotNull public @NotNull Collection<Object> getRealValuesOrRawTypes(PrismContext prismContext)
- Specified by:
getRealValuesOrRawTypes
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
isSingleValue
public boolean isSingleValue()
Description copied from interface:Item
Returns true if the item contains 0 or 1 values and (by definition) is not multivalued.- Specified by:
isSingleValue
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
add
public boolean add(@NotNull @NotNull PrismContainerValue<Containerable> newValue) throws SchemaException
Description copied from interface:Item
Adds a given value, overwriting existing one. It compares values using DEFAULT_FOR_EQUALS (DATA) strategy, so it e.g. takes value metadata differences into account. It is because this method is used during parsing, internal computations (typically using generated beans), and similar situations where we expect little sophistication when it comes to value comparison. The less surprises the better.- Specified by:
add
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Throws:
SchemaException
-
add
public boolean add(@NotNull @NotNull PrismContainerValue<Containerable> newValue, @NotNull @NotNull EquivalenceStrategy strategy) throws SchemaException
Description copied from interface:Item
Adds a value, overwriting existing one(s). Uses specified equivalence strategy.- Specified by:
add
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Returns:
- true if this item changed as a result of the call. This is either during real value addition or during overwriting existing value with a different one. The "difference" is taken using the DEFAULT_FOR_EQUALS (DATA) equivalence strategy.
- Throws:
SchemaException
-
addIgnoringEquivalents
public void addIgnoringEquivalents(@NotNull @NotNull PrismContainerValue<Containerable> newValue) throws SchemaException
Description copied from interface:Item
Adds a value, not looking for equivalent values. (This means that the new value is always added, if possible.) Note that we check the cardinality of the item according to its definition, i.e. we do not allow single-valued item to contain more than one value.- Specified by:
addIgnoringEquivalents
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Throws:
SchemaException
-
addAll
public boolean addAll(Collection<PrismContainerValue<Containerable>> newValues) throws SchemaException
Description copied from interface:Item
Adds given values, with the same semantics as repeated add(..) calls.- Specified by:
addAll
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Returns:
- true if this item changed as a result of the call (i.e. if at least one value was really added)
- Throws:
SchemaException
-
addAll
public boolean addAll(Collection<PrismContainerValue<Containerable>> newValues, @NotNull @NotNull EquivalenceStrategy strategy) throws SchemaException
Description copied from interface:Item
Adds given values, with the same semantics as repeated add(..) calls. For equality testing uses given strategy.- Specified by:
addAll
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Returns:
- true if this item changed as a result of the call (i.e. if at least one value was really added)
- Throws:
SchemaException
-
addRespectingMetadataAndCloning
public void addRespectingMetadataAndCloning(PrismContainerValue<Containerable> value, @NotNull @NotNull EquivalenceStrategy strategy, EquivalenceStrategy metadataEquivalenceStrategy) throws SchemaException
Description copied from interface:Item
Adds a value, respecting the metadata. I.e. if equivalent value exists, the metadata are merged. (Replacing metadata of colliding provenance, adding all the others.) If a value is to be added as a whole, it is cloned.- Specified by:
addRespectingMetadataAndCloning
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Throws:
SchemaException
-
removeRespectingMetadata
public void removeRespectingMetadata(PrismContainerValue<Containerable> value, @NotNull @NotNull EquivalenceStrategy strategy, EquivalenceStrategy metadataEquivalenceStrategy)
Description copied from interface:Item
Removes values equivalent to given value from the item; under specified equivalence strategy OR when values represent the same value via "representsSameValue(.., lax=false)" method. Respects metadata, i.e. if value to be removed has metadata specified, this method removes only particular metadata. Only if this means that all metadata are gone, then the value is deleted.- Specified by:
removeRespectingMetadata
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
remove
public boolean remove(PrismContainerValue<Containerable> value)
Description copied from interface:Item
Removes values equivalent to given value from the item. Note we use REAL_VALUE_CONSIDER_DIFFERENT_IDS strategy that ignores value metadata and operational data. This may or may not be good! TODO reconsider- Specified by:
remove
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
remove
public boolean remove(PrismContainerValue<Containerable> value, @NotNull @NotNull EquivalenceStrategy strategy)
Description copied from interface:Item
Removes values equivalent to given value from the item; under specified equivalence strategy OR when values represent the same value via "representsSameValue(.., lax=false)" method.- Specified by:
remove
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Returns:
- true if this item changed as a result of the call (i.e. if at least one value was really removed)
-
removeAll
public boolean removeAll(Collection<PrismContainerValue<Containerable>> values, @NotNull @NotNull EquivalenceStrategy strategy)
Description copied from interface:Item
Removes all given values from the item. It is basically a shortcut for repeatedItem.remove(PrismValue, EquivalenceStrategy)
call.- Specified by:
removeAll
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Returns:
- true if this item changed as a result of the call (i.e. if at least one value was really removed)
-
clear
public void clear()
Description copied from interface:Item
Removes all values from the item.- Specified by:
clear
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
replaceAll
public void replaceAll(Collection<PrismContainerValue<Containerable>> newValues, @NotNull @NotNull EquivalenceStrategy strategy) throws SchemaException
Description copied from interface:Item
Replaces all values of the item by given values.- Specified by:
replaceAll
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Throws:
SchemaException
-
replace
public void replace(PrismContainerValue<Containerable> newValue) throws SchemaException
Description copied from interface:Item
Replaces all values of the item by given value.- Specified by:
replace
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Throws:
SchemaException
-
equals
public boolean equals(Object obj)
Description copied from interface:Item
Compares this item to the specified object under DEFAULT_FOR_EQUALS (DATA) strategy.- Specified by:
equals
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Overrides:
equals
in classObject
-
equals
public boolean equals(Object obj, @NotNull @NotNull EquivalenceStrategy equivalenceStrategy)
Description copied from interface:Item
Compares this item to the specified object under given strategy.- Specified by:
equals
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
equals
public boolean equals(Object obj, @NotNull @NotNull ParameterizedEquivalenceStrategy equivalenceStrategy)
Description copied from interface:Item
Compares this item to the specified object under given strategy.- Specified by:
equals
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
hashCode
public int hashCode()
Description copied from interface:Item
Computes hash code to be used under DEFAULT_FOR_EQUALS (currently DATA) equivalence strategy.- Specified by:
hashCode
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Overrides:
hashCode
in classObject
-
hashCode
public int hashCode(@NotNull @NotNull EquivalenceStrategy equivalenceStrategy)
Description copied from interface:Item
Computes hash code to be used under given equivalence strategy.- Specified by:
hashCode
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
hashCode
public int hashCode(@NotNull @NotNull ParameterizedEquivalenceStrategy equivalenceStrategy)
Description copied from interface:Item
Computes hash code to be used under given equivalence strategy.- Specified by:
hashCode
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
contains
public boolean contains(@NotNull @NotNull PrismContainerValue<Containerable> value)
- Specified by:
contains
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Returns:
- true if the item contains a given value (by default using DEFAULT_FOR_EQUALS i.e. DATA strategy) Note that the "sameness" (ID-only value matching) is NOT considered here.
-
contains
public boolean contains(@NotNull @NotNull PrismContainerValue<Containerable> value, @NotNull @NotNull EquivalenceStrategy strategy)
- Specified by:
contains
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Returns:
- true if the item contains a given value under specified equivalence strategy Note that the "sameness" (ID-only value matching) is NOT considered here.
-
findValue
public PrismContainerValue<Containerable> findValue(@NotNull @NotNull PrismContainerValue<Containerable> value, @NotNull @NotNull EquivalenceStrategy strategy)
- Specified by:
findValue
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Returns:
- a value of this item that is equivalent to the given one under given equivalence strategy (or null if no such value exists)
-
findValue
public PrismContainerValue<Containerable> findValue(PrismContainerValue<Containerable> value, @NotNull @NotNull Comparator<PrismContainerValue<Containerable>> comparator)
- Specified by:
findValue
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Returns:
- a value of this item that is equivalent to the given one under given comparator (or null if no such value exists)
-
diff
public ItemDelta<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>> diff(Item<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>> other)
Description copied from interface:Item
Computes a difference (delta) with the specified item using DEFAULT_FOR_DELTA_APPLICATION (REAL_VALUE_CONSIDER_DIFFERENT_IDS) equivalence strategy. Compares item values only -- does NOT dive into lower levels.- Specified by:
diff
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
diff
public ItemDelta<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>> diff(Item<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>> other, @NotNull @NotNull ParameterizedEquivalenceStrategy strategy)
Description copied from interface:Item
Computes a difference (delta) with the specified item using given equivalence strategy. Note this method cannot accept general EquivalenceStrategy here; it needs the parameterized strategy. Compares item values only -- does NOT dive into lower levels.- Specified by:
diff
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
getClonedValues
public Collection<PrismContainerValue<Containerable>> getClonedValues()
- Specified by:
getClonedValues
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
normalize
public void normalize()
Description copied from interface:Item
Currently doing nothing.- Specified by:
normalize
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
merge
public void merge(Item<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>> otherItem) throws SchemaException
Description copied from interface:Item
Merge all the values of other item to this item.- Specified by:
merge
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Throws:
SchemaException
-
find
public Object find(ItemPath path)
Description copied from interface:Item
Returns object (Item or PrismValue) pointed to by the given path.- Specified by:
find
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
acceptParentVisitor
public void acceptParentVisitor(@NotNull @NotNull Visitor visitor)
Description copied from interface:Item
Accepts a visitor that visits each item/value on the way to the structure root.- Specified by:
acceptParentVisitor
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Specified by:
acceptParentVisitor
in interfaceParentVisitable
-
recomputeAllValues
public void recomputeAllValues()
Description copied from interface:Item
Re-apply PolyString (and possible other) normalizations to the object.- Specified by:
recomputeAllValues
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
applyDefinition
public void applyDefinition(PrismContainerDefinition<Containerable> definition, boolean force) throws SchemaException
- Specified by:
applyDefinition
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Throws:
SchemaException
-
cloneCollection
public static <T extends Item<?,?>> Collection<T> cloneCollection(Collection<T> items)
-
resetParentCollection
public static <T extends Item> Collection<T> resetParentCollection(Collection<T> items)
Description copied from interface:Item
Sets all parents to null. This is good if the items are to be "transplanted" into a different Containerable.
-
checkConsistence
public void checkConsistence(boolean requireDefinitions, ConsistencyCheckScope scope)
- Specified by:
checkConsistence
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
checkConsistence
public void checkConsistence(boolean requireDefinitions, boolean prohibitRaw)
- Specified by:
checkConsistence
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
checkConsistence
public void checkConsistence(boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
- Specified by:
checkConsistence
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
checkConsistence
public void checkConsistence()
- Specified by:
checkConsistence
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
checkConsistence
public void checkConsistence(ConsistencyCheckScope scope)
- Specified by:
checkConsistence
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
checkConsistenceInternal
public void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
- Specified by:
checkConsistenceInternal
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
assertDefinitions
public void assertDefinitions() throws SchemaException
- Specified by:
assertDefinitions
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Throws:
SchemaException
-
assertDefinitions
public void assertDefinitions(Supplier<String> sourceDescriptionSupplier) throws SchemaException
- Specified by:
assertDefinitions
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Throws:
SchemaException
-
assertDefinitions
public void assertDefinitions(boolean tolerateRawValues, Supplier<String> sourceDescriptionSupplier) throws SchemaException
- Specified by:
assertDefinitions
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
- Throws:
SchemaException
-
isRaw
public boolean isRaw()
Description copied from interface:Item
Returns true is all the values are raw.- Specified by:
isRaw
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
hasRaw
public boolean hasRaw()
Description copied from interface:Item
Returns true is at least one of the values is raw.- Specified by:
hasRaw
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
isEmpty
public boolean isEmpty()
Description copied from interface:Item
Normally the same asItem.hasNoValues()
. But a container is considered empty also if all its values (PCVs) are empty. This is a bit strange and should be revisited.- Specified by:
isEmpty
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
hasNoValues
public boolean hasNoValues()
- Specified by:
hasNoValues
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
hasNoValues
public static boolean hasNoValues(Item<?,?> item)
-
isOperational
public boolean isOperational()
Description copied from interface:Item
Returns true if this item is metadata item that should be ignored for metadata-insensitive comparisons and hashCode functions.- Specified by:
isOperational
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
getValues
@NotNull public static <V extends PrismValue> @NotNull Collection<V> getValues(Item<V,?> item)
-
getAllValues
@NotNull public @NotNull Collection<PrismValue> getAllValues(ItemPath path)
- Specified by:
getAllValues
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
getAllValues
@NotNull public static @NotNull Collection<PrismValue> getAllValues(Item<?,?> item, ItemPath path)
-
getPrismContextLocal
public PrismContext getPrismContextLocal()
- Specified by:
getPrismContextLocal
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
setPrismContext
public void setPrismContext(PrismContext prismContext)
- Specified by:
setPrismContext
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
getHighestId
public Long getHighestId()
- Specified by:
getHighestId
in interfaceItem<PrismContainerValue<Containerable>,PrismContainerDefinition<Containerable>>
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
-
revive
public void revive(PrismContext prismContext)
Description copied from interface:Revivable
TODO: Is revive necessary if prism context is static? TODO document (if it's found to be necessary)
-
isImmutable
public boolean isImmutable()
- Specified by:
isImmutable
in interfaceFreezable
-
checkMutable
public void checkMutable()
- Specified by:
checkMutable
in interfaceFreezable
-
checkImmutable
public void checkImmutable()
- Specified by:
checkImmutable
in interfaceFreezable
-
getComplexTypeDefinition
public ComplexTypeDefinition getComplexTypeDefinition()
- Specified by:
getComplexTypeDefinition
in interfacePrismContainerable<Containerable>
-
-