Package com.evolveum.midpoint.prism
Interface PrismContainerValue<C extends Containerable>
- All Superinterfaces:
DebugDumpable
,Freezable
,MidpointOriginMetadata
,ParentVisitable
,PathVisitable
,PrismContextSensitive
,PrismValue
,Revivable
,Serializable
,Visitable
- All Known Subinterfaces:
PrismObjectValue<O>
- Author:
- semancik
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Used when accessing an item whose definition was removed. -
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
acceptParentVisitor
(Visitor visitor) <IV extends PrismValue,
ID extends ItemDefinition<?>>
void<IV extends PrismValue,
ID extends ItemDefinition<?>>
voidAdds an item to a property container.void
addAll
(Collection<? extends Item<?, ?>> itemsToAdd) Adds a collection of items to a property container.void
addAllReplaceExisting
(Collection<? extends Item<?, ?>> itemsToAdd) Adds a collection of items to a property container.boolean
addRawElement
(Object element) <IV extends PrismValue,
ID extends ItemDefinition<?>>
voidaddReplaceExisting
(Item<IV, ID> item) Adds an item to a property container.void
applyDefinition
(@NotNull PrismContainerDefinition<C> containerDef, boolean force) void
applyDefinition
(ItemDefinition definition, boolean force) static <T extends Containerable>
TasContainerable
(PrismContainerValue<T> value) asContainerable
(Class<C> requiredClass) static <C extends Containerable>
Collection<C>asContainerables
(Collection<PrismContainerValue<C>> pcvs) static <C extends Containerable>
List<C>asContainerables
(List<PrismContainerValue<C>> pcvs) static <C extends Containerable>
List<PrismContainerValue<C>>asPrismContainerValues
(List<C> containerables) void
assertDefinitions
(boolean tolerateRaw, Supplier<String> sourceDescriptionSupplier) void
assertDefinitions
(Supplier<String> sourceDescriptionSupplier) asSingleValuedContainer
(@NotNull QName itemName) Returns a single-valued container (with a single-valued definition) holding just this value.boolean
canRepresent
(Class<?> clazz) void
clear()
clone()
Literal clone.cloneComplex
(CloneStrategy strategy) Complex clone with different cloning strategies.boolean
boolean
boolean
containsItem
(ItemPath propPath, boolean acceptEmptyItem) static <C extends Containerable>
booleancontainsRealValue
(Collection<PrismContainerValue<C>> cvalCollection, PrismContainerValue<C> cval) <IV extends PrismValue,
ID extends ItemDefinition<?>, I extends Item<IV, ID>>
IcreateDetachedSubItem
(QName name, Class<I> type, ID itemDefinition, boolean immutable) <X> PrismProperty<X>
createProperty
(PrismPropertyDefinition propertyDefinition) <X> PrismProperty<X>
createProperty
(QName propertyName) boolean
deleteRawElement
(Object element) boolean
equivalent
(PrismContainerValue<?> other) <X extends Containerable>
PrismContainer<X>findContainer
(QName containerName) <IV extends PrismValue,
ID extends ItemDefinition<?>, I extends Item<IV, ID>>
IfindItem
(ItemDefinition itemDefinition, Class<I> type) default <IV extends PrismValue,
ID extends ItemDefinition<?>>
Item<IV,ID> <IV extends PrismValue,
ID extends ItemDefinition<?>, I extends Item<IV, ID>>
I<T extends Containerable>
PrismContainer<T>findOrCreateContainer
(QName containerName) <IV extends PrismValue,
ID extends ItemDefinition<?>, I extends Item<IV, ID>>
IfindOrCreateItem
(ItemPath path, Class<I> type, ID definition) <IV extends PrismValue,
ID extends ItemDefinition<?>>
Item<IV,ID> findOrCreateItem
(QName containerName) <IV extends PrismValue,
ID extends ItemDefinition<?>, I extends Item<IV, ID>>
IfindOrCreateItem
(QName containerName, Class<I> type) <X> PrismProperty<X>
findOrCreateProperty
(ItemPath propertyPath) <X> PrismProperty<X>
findOrCreateProperty
(PrismPropertyDefinition propertyDef) findOrCreateReference
(QName referenceName) <IV extends PrismValue,
ID extends ItemDefinition<?>>
PartiallyResolvedItem<IV,ID> findPartial
(ItemPath path) <X> PrismProperty<X>
findProperty
(ItemPath propertyPath) <X> PrismProperty<X>
findProperty
(PrismPropertyDefinition<X> propertyDefinition) Finds a specific property in the container by definition.findReference
(QName elementName) findReferenceByCompositeObjectElementName
(QName elementName) @Nullable ComplexTypeDefinition
getId()
static Long
getId
(PrismValue value) @NotNull Collection<QName>
default <T> T
getItemRealValue
(ItemName itemName, Class<T> type) @NotNull Collection<Item<?,
?>> getItems()
Returns a collection of items that the property container contains.@NotNull Set<PrismProperty<?>>
Returns a set of properties that the property container contains.<T> T
getPropertyRealValue
(QName propertyName, Class<T> type) @NotNull PrismContainerValue<?>
getValue()
boolean
Returns true if all contained items have complete definitions.boolean
Like isEmpty but ignores presence of container value ID.static boolean
idsMatch
(PrismValue v1, PrismValue v2) boolean
isIdOnly()
static boolean
isIdOnly
(PrismValue value) void
<IV extends PrismValue,
ID extends ItemDefinition<?>>
booleanMerges the provided item into this item.void
mergeContent
(@NotNull PrismContainerValue<?> other, @NotNull List<QName> overwrite) void
recompute
(PrismContext prismContext) <IV extends PrismValue,
ID extends ItemDefinition<?>>
voidvoid
void
removeContainer
(ItemPath path) void
removeItems
(List<? extends ItemPath> itemsToRemove) void
void
removePaths
(List<? extends ItemPath> remove) void
removeProperty
(ItemPath path) boolean
removeRawElement
(Object element) void
removeReference
(ItemPath path) <IV extends PrismValue,
ID extends ItemDefinition<?>>
voidvoid
void
setOriginTypeRecursive
(OriginType originType) Set origin type to all values and subvalues<T> void
setPropertyRealValue
(QName propertyName, T realValue, PrismContext prismContext) int
size()
<IV extends PrismValue,
ID extends ItemDefinition<?>>
booleanSubtract the provided item from this item.static <T extends Containerable>
List<PrismContainerValue<T>>Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDump, debugDumpLazily, debugDumpLazily
Methods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze, isImmutable
Methods inherited from interface com.evolveum.midpoint.prism.metadata.MidpointOriginMetadata
getOriginObject, getOriginType, setOriginObject, setOriginType
Methods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContext
Methods inherited from interface com.evolveum.midpoint.prism.PrismValue
applyDefinition, checkConsistenceInternal, clearParent, cloneIfImmutable, diff, equals, equals, find, getAllItems, getAllValues, getNearestValueOfType, getParentContainerValue, getPath, getRealClass, getRealValue, getRealValueIfExists, getRealValueOrRawType, getRootObjectable, getTypeName, getUserData, getUserData, getValueMetadata, getValueMetadataAsContainer, hashCode, hashCode, hasRealClass, hasValueMetadata, isEmpty, isObjectable, isOfType, isRaw, isTransient, normalize, recompute, representsSameValue, setParent, setPrismContext, setTransient, setUserData, setValueMetadata, setValueMetadata, setValueMetadata, toHumanReadableString, valueMetadata
-
Method Details
-
asContainerable
-
getPrismContextLocal
PrismContext getPrismContextLocal() -
getItems
Returns a collection of items that the property container contains. The items may be properties or inner property containers.Returned collection is mutable, but the caller should NOT modify it. Instead - e.g. if it needs to remove values - it should call remove() method.
- Returns:
- collection of items that the property container contains.
-
size
int size() -
getProperties
Returns a set of properties that the property container contains.Returned set is immutable! Any change to it will be ignored.
This method costs a bit, as the set of properties needs to be created. Consider using other methods if possible.
- Returns:
- set of properties that the property container contains.
-
getId
Long getId() -
setId
-
getParent
PrismContainerable<C> getParent()- Specified by:
getParent
in interfacePrismValue
-
getContainer
PrismContainer<C> getContainer() -
getValue
C getValue() -
asContainerable
-
getCompileTimeClass
-
canRepresent
-
asContainerable
-
getItemNames
-
add
<IV extends PrismValue,ID extends ItemDefinition<?>> void add(Item<IV, ID> item) throws SchemaException- Throws:
SchemaException
-
add
<IV extends PrismValue,ID extends ItemDefinition<?>> void add(Item<IV, ID> item, boolean checkUniqueness) throws SchemaExceptionAdds an item to a property container.- Parameters:
item
- item to add.- Throws:
IllegalArgumentException
- an attempt to add value that already existsSchemaException
-
merge
<IV extends PrismValue,ID extends ItemDefinition<?>> boolean merge(Item<IV, ID> item) throws SchemaExceptionMerges the provided item into this item. The values are joined together. Returns true if new item or value was added.- Throws:
SchemaException
-
subtract
<IV extends PrismValue,ID extends ItemDefinition<?>> boolean subtract(Item<IV, ID> item) throws SchemaExceptionSubtract the provided item from this item. The values of the provided item are deleted from this item. Returns true if this item was changed.- Throws:
SchemaException
-
addReplaceExisting
<IV extends PrismValue,ID extends ItemDefinition<?>> void addReplaceExisting(Item<IV, ID> item) throws SchemaExceptionAdds an item to a property container. Existing value will be replaced.- Parameters:
item
- item to add.- Throws:
SchemaException
-
remove
-
removeAll
void removeAll() -
addAll
Adds a collection of items to a property container.- Parameters:
itemsToAdd
- items to add- Throws:
IllegalArgumentException
- an attempt to add value that already existsSchemaException
-
addAllReplaceExisting
Adds a collection of items to a property container. Existing values will be replaced.- Parameters:
itemsToAdd
- items to add- Throws:
SchemaException
-
replace
<IV extends PrismValue,ID extends ItemDefinition<?>> void replace(Item<IV, ID> oldItem, Item<IV, throws SchemaExceptionID> newItem) - Throws:
SchemaException
-
clear
void clear() -
contains
-
contains
-
containsRealValue
static <C extends Containerable> boolean containsRealValue(Collection<PrismContainerValue<C>> cvalCollection, PrismContainerValue<C> cval) -
findPartial
<IV extends PrismValue,ID extends ItemDefinition<?>> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path) -
findProperty
-
findProperty
Finds a specific property in the container by definition.Returns null if nothing is found.
- Parameters:
propertyDefinition
- property definition to find.- Returns:
- found property or null
-
findContainer
-
findReference
-
findReferenceByCompositeObjectElementName
-
findItem
<IV extends PrismValue,ID extends ItemDefinition<?>, I findItemI extends Item<IV, ID>> (ItemPath itemName, Class<I> type) -
findItem
default <IV extends PrismValue,ID extends ItemDefinition<?>> Item<IV,ID> findItem(ItemPath itemPath) -
findItem
<IV extends PrismValue,ID extends ItemDefinition<?>, I findItemI extends Item<IV, ID>> (ItemDefinition itemDefinition, Class<I> type) -
containsItem
- Throws:
SchemaException
-
createDetachedSubItem
<IV extends PrismValue,ID extends ItemDefinition<?>, I createDetachedSubItemI extends Item<IV, ID>> (QName name, Class<I> type, ID itemDefinition, boolean immutable) throws SchemaException, PrismContainerValue.RemovedItemDefinitionException -
findOrCreateContainer
<T extends Containerable> PrismContainer<T> findOrCreateContainer(QName containerName) throws SchemaException - Throws:
SchemaException
-
findOrCreateReference
- Throws:
SchemaException
-
findOrCreateItem
<IV extends PrismValue,ID extends ItemDefinition<?>> Item<IV,ID> findOrCreateItem(QName containerName) throws SchemaException - Throws:
SchemaException
-
findOrCreateItem
<IV extends PrismValue,ID extends ItemDefinition<?>, I findOrCreateItemI extends Item<IV, ID>> (QName containerName, Class<I> type) throws SchemaException - Throws:
SchemaException
-
findOrCreateItem
<IV extends PrismValue,ID extends ItemDefinition<?>, I findOrCreateItemI extends Item<IV, ID>> (ItemPath path, Class<I> type, ID definition) throws SchemaException - Throws:
SchemaException
-
findOrCreateProperty
- Throws:
SchemaException
-
findOrCreateProperty
<X> PrismProperty<X> findOrCreateProperty(PrismPropertyDefinition propertyDef) throws SchemaException - Throws:
SchemaException
-
createProperty
- Throws:
SchemaException
-
createProperty
<X> PrismProperty<X> createProperty(PrismPropertyDefinition propertyDefinition) throws SchemaException - Throws:
SchemaException
-
removeProperty
-
removeContainer
-
removeReference
-
setPropertyRealValue
<T> void setPropertyRealValue(QName propertyName, T realValue, PrismContext prismContext) throws SchemaException - Throws:
SchemaException
-
getPropertyRealValue
-
getItemRealValue
-
recompute
- Specified by:
recompute
in interfacePrismValue
-
accept
- Specified by:
accept
in interfacePrismValue
- Specified by:
accept
in interfaceVisitable<C extends Containerable>
-
accept
- Specified by:
accept
in interfacePathVisitable
- Specified by:
accept
in interfacePrismValue
-
hasCompleteDefinition
boolean hasCompleteDefinition()Returns true if all contained items have complete definitions. (Currently does not check the definition of this value itself.) -
addRawElement
- Throws:
SchemaException
-
deleteRawElement
- Throws:
SchemaException
-
removeRawElement
-
applyDefinition
- Specified by:
applyDefinition
in interfacePrismValue
- Throws:
SchemaException
-
applyDefinition
void applyDefinition(@NotNull @NotNull PrismContainerDefinition<C> containerDef, boolean force) throws SchemaException - Throws:
SchemaException
-
isIdOnly
boolean isIdOnly() -
isIdOnly
-
getId
-
idsMatch
-
assertDefinitions
- Throws:
SchemaException
-
assertDefinitions
void assertDefinitions(boolean tolerateRaw, Supplier<String> sourceDescriptionSupplier) throws SchemaException - Throws:
SchemaException
-
clone
PrismContainerValue<C> clone()Description copied from interface:PrismValue
Literal clone.- Specified by:
clone
in interfacePrismValue
-
createImmutableClone
PrismContainerValue<C> createImmutableClone()- Specified by:
createImmutableClone
in interfacePrismValue
-
cloneComplex
Description copied from interface:PrismValue
Complex clone with different cloning strategies.- Specified by:
cloneComplex
in interfacePrismValue
- See Also:
-
equivalent
-
getComplexTypeDefinition
-
toPcvList
-
asSingleValuedContainer
Returns a single-valued container (with a single-valued definition) holding just this value.- Parameters:
itemName
- Item name for newly-created container.- Throws:
SchemaException
-
mergeContent
void mergeContent(@NotNull @NotNull PrismContainerValue<?> other, @NotNull @NotNull List<QName> overwrite) throws SchemaException - Throws:
SchemaException
-
getRootValue
- Specified by:
getRootValue
in interfacePrismValue
-
asPrismContainerValues
static <C extends Containerable> List<PrismContainerValue<C>> asPrismContainerValues(List<C> containerables) -
asContainerables
-
asContainerables
static <C extends Containerable> Collection<C> asContainerables(Collection<PrismContainerValue<C>> pcvs) -
setOriginTypeRecursive
Set origin type to all values and subvalues -
keepPaths
- Throws:
SchemaException
-
removePaths
- Throws:
SchemaException
-
removeItems
-
removeOperationalItems
void removeOperationalItems() -
getDefinition
PrismContainerDefinition<C> getDefinition() -
acceptParentVisitor
- Specified by:
acceptParentVisitor
in interfaceParentVisitable
-
hasNoItems
boolean hasNoItems()Like isEmpty but ignores presence of container value ID.
-