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
Nested ClassesModifier and TypeInterfaceDescriptionstatic classUsed 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 TypeMethodDescriptionvoidvoidvoidacceptParentVisitor(Visitor visitor) <IV extends PrismValue,ID extends ItemDefinition<?>>
void<IV extends PrismValue,ID extends ItemDefinition<?>>
voidAdds an item to a property container.voidaddAll(Collection<? extends Item<?, ?>> itemsToAdd) Adds a collection of items to a property container.voidaddAllReplaceExisting(Collection<? extends Item<?, ?>> itemsToAdd) Adds a collection of items to a property container.booleanaddRawElement(Object element) <IV extends PrismValue,ID extends ItemDefinition<?>>
voidaddReplaceExisting(Item<IV, ID> item) Adds an item to a property container.voidapplyDefinition(@NotNull PrismContainerDefinition<C> containerDef, boolean force) voidapplyDefinition(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) voidassertDefinitions(boolean tolerateRaw, Supplier<String> sourceDescriptionSupplier) voidassertDefinitions(Supplier<String> sourceDescriptionSupplier) asSingleValuedContainer(@NotNull QName itemName) Returns a single-valued container (with a single-valued definition) holding just this value.booleancanRepresent(Class<?> clazz) voidclear()clone()Literal clone.cloneComplex(CloneStrategy strategy) Complex clone with different cloning strategies.booleanbooleanbooleancontainsItem(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) booleandeleteRawElement(Object element) booleanequivalent(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 ComplexTypeDefinitiongetId()static LonggetId(PrismValue value) @NotNull Collection<QName>default <T> TgetItemRealValue(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> TgetPropertyRealValue(QName propertyName, Class<T> type) @NotNull PrismContainerValue<?>getValue()booleanReturns true if all contained items have complete definitions.booleanLike isEmpty but ignores presence of container value ID.static booleanidsMatch(PrismValue v1, PrismValue v2) booleanisIdOnly()static booleanisIdOnly(PrismValue value) void<IV extends PrismValue,ID extends ItemDefinition<?>>
booleanMerges the provided item into this item.voidmergeContent(@NotNull PrismContainerValue<?> other, @NotNull List<QName> overwrite) voidrecompute(PrismContext prismContext) <IV extends PrismValue,ID extends ItemDefinition<?>>
voidvoidvoidremoveContainer(ItemPath path) voidremoveItems(List<? extends ItemPath> itemsToRemove) voidvoidremovePaths(List<? extends ItemPath> remove) voidremoveProperty(ItemPath path) booleanremoveRawElement(Object element) voidremoveReference(ItemPath path) <IV extends PrismValue,ID extends ItemDefinition<?>>
voidvoidvoidsetOriginTypeRecursive(OriginType originType) Set origin type to all values and subvalues<T> voidsetPropertyRealValue(QName propertyName, T realValue, PrismContext prismContext) intsize()<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, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze, isImmutableMethods inherited from interface com.evolveum.midpoint.prism.metadata.MidpointOriginMetadata
getOriginObject, getOriginType, setOriginObject, setOriginTypeMethods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContextMethods 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:
getParentin 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:
recomputein interfacePrismValue
-
accept
- Specified by:
acceptin interfacePrismValue- Specified by:
acceptin interfaceVisitable<C extends Containerable>
-
accept
- Specified by:
acceptin interfacePathVisitable- Specified by:
acceptin 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:
applyDefinitionin 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:PrismValueLiteral clone.- Specified by:
clonein interfacePrismValue
-
createImmutableClone
PrismContainerValue<C> createImmutableClone()- Specified by:
createImmutableClonein interfacePrismValue
-
cloneComplex
Description copied from interface:PrismValueComplex clone with different cloning strategies.- Specified by:
cloneComplexin 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:
getRootValuein 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:
acceptParentVisitorin interfaceParentVisitable
-
hasNoItems
boolean hasNoItems()Like isEmpty but ignores presence of container value ID.
-