Package com.evolveum.midpoint.prism
Interface PrismContainerValue<C extends Containerable>
-
- All Superinterfaces:
DebugDumpable
,ParentVisitable
,PathVisitable
,PrismValue
,Revivable
,Serializable
,Visitable
- All Known Subinterfaces:
PrismObjectValue<O>
public interface PrismContainerValue<C extends Containerable> extends PrismValue, ParentVisitable
- Author:
- semancik
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
accept(Visitor visitor)
void
accept(Visitor visitor, ItemPath path, boolean recursive)
void
acceptParentVisitor(Visitor visitor)
<IV extends PrismValue,ID extends ItemDefinition>
voidadd(Item<IV,ID> item)
<IV extends PrismValue,ID extends ItemDefinition>
voidadd(Item<IV,ID> item, boolean checkUniqueness)
Adds 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(ItemDefinition definition, boolean force)
void
applyDefinition(PrismContainerDefinition<C> containerDef, boolean force)
C
asContainerable()
static <T extends Containerable>
TasContainerable(PrismContainerValue<T> value)
C
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, String sourceDescription)
void
assertDefinitions(String sourceDescription)
PrismContainer<C>
asSingleValuedContainer(QName itemName)
Returns a single-valued container (with a single-valued definition) holding just this value.boolean
canRepresent(Class<?> clazz)
void
checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
void
clear()
PrismContainerValue<C>
clone()
Literal clone.PrismContainerValue<C>
cloneComplex(CloneStrategy strategy)
Complex clone with different cloning strategies.boolean
contains(Item item)
boolean
contains(ItemName itemName)
boolean
containsItem(ItemPath propPath, boolean acceptEmptyItem)
static <C extends Containerable>
booleancontainsRealValue(Collection<PrismContainerValue<C>> cvalCollection, PrismContainerValue<C> cval)
static void
copyDefinition(Containerable aClone, Containerable original, PrismContext prismContext)
Deprecated.<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)
String
debugDump(int indent)
boolean
deleteRawElement(Object element)
boolean
equals(Object obj)
boolean
equivalent(PrismContainerValue<?> other)
Object
find(ItemPath path)
<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>findItem(ItemPath itemPath)
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>>
IfindItem(ItemPath itemName, Class<I> type)
<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)
PrismReference
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.PrismReference
findReference(QName elementName)
PrismReference
findReferenceByCompositeObjectElementName(QName elementName)
Collection<PrismValue>
getAllValues(ItemPath path)
Class<C>
getCompileTimeClass()
ComplexTypeDefinition
getComplexTypeDefinition()
PrismContainer<C>
getContainer()
PrismContainerDefinition<C>
getDefinition()
Long
getId()
Collection<QName>
getItemNames()
Collection<Item<?,?>>
getItems()
Returns a collection of items that the property container contains.PrismContainerable<C>
getParent()
ItemPath
getPath()
PrismContext
getPrismContext()
PrismContext
getPrismContextLocal()
Set<PrismProperty<?>>
getProperties()
Returns a set of properties that the property container contains.<T> T
getPropertyRealValue(QName propertyName, Class<T> type)
Class<?>
getRealClass()
<T> T
getRealValue()
PrismContainerValue<?>
getRootValue()
QName
getTypeName()
C
getValue()
boolean
hasCompleteDefinition()
int
hashCode()
boolean
hasNoItems()
Like isEmpty but ignores presence of container value ID.boolean
isEmpty()
boolean
isIdOnly()
boolean
isRaw()
void
keepPaths(List<? extends ItemPath> keep)
<IV extends PrismValue,ID extends ItemDefinition>
booleanmerge(Item<IV,ID> item)
Merges the provided item into this item.void
mergeContent(PrismContainerValue<?> other, List<QName> overwrite)
void
normalize()
void
recompute(PrismContext prismContext)
<IV extends PrismValue,ID extends ItemDefinition>
voidremove(Item<IV,ID> item)
void
removeAll()
void
removeContainer(ItemPath path)
void
removeItems(List<? extends ItemPath> itemsToRemove)
void
removeOperationalItems()
void
removePaths(List<? extends ItemPath> remove)
void
removeProperty(ItemPath path)
boolean
removeRawElement(Object element)
void
removeReference(ItemPath path)
<IV extends PrismValue,ID extends ItemDefinition>
voidreplace(Item<IV,ID> oldItem, Item<IV,ID> newItem)
void
revive(PrismContext prismContext)
void
setId(Long id)
void
setImmutable(boolean immutable)
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(Item<IV,ID> item)
Subtract the provided item from this item.String
toHumanReadableString()
static <T extends Containerable>
List<PrismContainerValue<T>>toPcvList(List<T> beans)
String
toString()
-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismValue
applyDefinition, clearParent, diff, diff, equals, equals, equals, getOriginObject, getOriginType, getParentContainerValue, getUserData, getUserData, hashCode, hashCode, isImmutable, recompute, representsSameValue, setOriginObject, setOriginType, setParent, setPrismContext, setUserData
-
-
-
-
Method Detail
-
asContainerable
static <T extends Containerable> T asContainerable(PrismContainerValue<T> value)
-
getPrismContext
PrismContext getPrismContext()
- Specified by:
getPrismContext
in interfacePrismValue
-
getPrismContextLocal
PrismContext getPrismContextLocal()
-
getItems
@NotNull @Contract(pure=true) Collection<Item<?,?>> 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
@NotNull Set<PrismProperty<?>> getProperties()
Returns a set of properties that the property container contains.Returned set is immutable! Any change to it will be ignored.
- Returns:
- set of properties that the property container contains. This method costs a bit, as the set of properties needs to be created. Consider using other methods if possible.
-
getId
Long getId()
-
setId
void setId(Long id)
-
getParent
PrismContainerable<C> getParent()
- Specified by:
getParent
in interfacePrismValue
-
getContainer
PrismContainer<C> getContainer()
-
getPath
@NotNull ItemPath getPath()
- Specified by:
getPath
in interfacePrismValue
-
getValue
C getValue()
-
asContainerable
@NotNull C asContainerable()
-
canRepresent
boolean canRepresent(Class<?> clazz)
-
getItemNames
@NotNull Collection<QName> 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 SchemaException
Adds an item to a property container.- Parameters:
item
- item to add.- Throws:
SchemaException
IllegalArgumentException
- an attempt to add value that already exists
-
merge
<IV extends PrismValue,ID extends ItemDefinition> boolean merge(Item<IV,ID> item) throws SchemaException
Merges 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 SchemaException
Subtract 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 SchemaException
Adds an item to a property container. Existing value will be replaced.- Parameters:
item
- item to add.- Throws:
SchemaException
-
remove
<IV extends PrismValue,ID extends ItemDefinition> void remove(Item<IV,ID> item)
-
removeAll
void removeAll()
-
addAll
void addAll(Collection<? extends Item<?,?>> itemsToAdd) throws SchemaException
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
void addAllReplaceExisting(Collection<? extends Item<?,?>> itemsToAdd) throws SchemaException
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,ID> newItem) throws SchemaException
- Throws:
SchemaException
-
clear
void clear()
-
contains
boolean contains(Item item)
-
contains
boolean contains(ItemName itemName)
-
containsRealValue
static <C extends Containerable> boolean containsRealValue(Collection<PrismContainerValue<C>> cvalCollection, PrismContainerValue<C> cval)
-
find
Object find(ItemPath path)
- Specified by:
find
in interfacePrismValue
-
findPartial
<IV extends PrismValue,ID extends ItemDefinition> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path)
-
findProperty
<X> PrismProperty<X> findProperty(ItemPath propertyPath)
-
findProperty
<X> PrismProperty<X> findProperty(PrismPropertyDefinition<X> propertyDefinition)
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
<X extends Containerable> PrismContainer<X> findContainer(QName containerName)
-
findReference
PrismReference findReference(QName elementName)
-
findReferenceByCompositeObjectElementName
PrismReference findReferenceByCompositeObjectElementName(QName elementName)
-
findItem
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findItem(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 extends Item<IV,ID>> I findItem(ItemDefinition itemDefinition, Class<I> type)
-
containsItem
boolean containsItem(ItemPath propPath, boolean acceptEmptyItem) throws SchemaException
- Throws:
SchemaException
-
createDetachedSubItem
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I createDetachedSubItem(QName name, Class<I> type, ID itemDefinition, boolean immutable) throws SchemaException
- Throws:
SchemaException
-
findOrCreateContainer
<T extends Containerable> PrismContainer<T> findOrCreateContainer(QName containerName) throws SchemaException
- Throws:
SchemaException
-
findOrCreateReference
PrismReference findOrCreateReference(QName referenceName) throws SchemaException
- 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 extends Item<IV,ID>> I findOrCreateItem(QName containerName, Class<I> type) throws SchemaException
- Throws:
SchemaException
-
findOrCreateItem
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> I findOrCreateItem(ItemPath path, Class<I> type, ID definition) throws SchemaException
- Throws:
SchemaException
-
findOrCreateProperty
<X> PrismProperty<X> findOrCreateProperty(ItemPath propertyPath) throws SchemaException
- Throws:
SchemaException
-
findOrCreateProperty
<X> PrismProperty<X> findOrCreateProperty(PrismPropertyDefinition propertyDef) throws SchemaException
- Throws:
SchemaException
-
createProperty
<X> PrismProperty<X> createProperty(QName propertyName) throws SchemaException
- Throws:
SchemaException
-
createProperty
<X> PrismProperty<X> createProperty(PrismPropertyDefinition propertyDefinition) throws SchemaException
- Throws:
SchemaException
-
removeProperty
void removeProperty(ItemPath path)
-
removeContainer
void removeContainer(ItemPath path)
-
removeReference
void removeReference(ItemPath path)
-
setPropertyRealValue
<T> void setPropertyRealValue(QName propertyName, T realValue, PrismContext prismContext) throws SchemaException
- Throws:
SchemaException
-
recompute
void recompute(PrismContext prismContext)
- Specified by:
recompute
in interfacePrismValue
-
accept
void accept(Visitor visitor)
- Specified by:
accept
in interfacePrismValue
- Specified by:
accept
in interfaceVisitable<C extends Containerable>
-
accept
void accept(Visitor visitor, ItemPath path, boolean recursive)
- Specified by:
accept
in interfacePathVisitable
- Specified by:
accept
in interfacePrismValue
-
hasCompleteDefinition
boolean hasCompleteDefinition()
-
isRaw
boolean isRaw()
- Specified by:
isRaw
in interfacePrismValue
-
addRawElement
boolean addRawElement(Object element) throws SchemaException
- Throws:
SchemaException
-
deleteRawElement
boolean deleteRawElement(Object element) throws SchemaException
- Throws:
SchemaException
-
removeRawElement
boolean removeRawElement(Object element)
-
applyDefinition
void applyDefinition(ItemDefinition definition, boolean force) throws SchemaException
- Specified by:
applyDefinition
in interfacePrismValue
- Throws:
SchemaException
-
applyDefinition
void applyDefinition(@NotNull PrismContainerDefinition<C> containerDef, boolean force) throws SchemaException
- Throws:
SchemaException
-
revive
void revive(PrismContext prismContext) throws SchemaException
- Specified by:
revive
in interfacePrismValue
- Specified by:
revive
in interfaceRevivable
- Throws:
SchemaException
-
isEmpty
boolean isEmpty()
- Specified by:
isEmpty
in interfacePrismValue
-
isIdOnly
boolean isIdOnly()
-
normalize
void normalize()
- Specified by:
normalize
in interfacePrismValue
-
checkConsistenceInternal
void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
- Specified by:
checkConsistenceInternal
in interfacePrismValue
-
assertDefinitions
void assertDefinitions(String sourceDescription) throws SchemaException
- Throws:
SchemaException
-
assertDefinitions
void assertDefinitions(boolean tolerateRaw, String sourceDescription) throws SchemaException
- Throws:
SchemaException
-
clone
PrismContainerValue<C> clone()
Description copied from interface:PrismValue
Literal clone.- Specified by:
clone
in interfacePrismValue
-
cloneComplex
PrismContainerValue<C> cloneComplex(CloneStrategy strategy)
Description copied from interface:PrismValue
Complex clone with different cloning strategies.- Specified by:
cloneComplex
in interfacePrismValue
- See Also:
CloneStrategy
-
equivalent
boolean equivalent(PrismContainerValue<?> other)
-
debugDump
String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
-
toHumanReadableString
String toHumanReadableString()
- Specified by:
toHumanReadableString
in interfacePrismValue
-
copyDefinition
@Deprecated static void copyDefinition(Containerable aClone, Containerable original, PrismContext prismContext)
Deprecated.
-
getTypeName
QName getTypeName()
- Specified by:
getTypeName
in interfacePrismValue
-
getComplexTypeDefinition
@Nullable ComplexTypeDefinition getComplexTypeDefinition()
-
toPcvList
static <T extends Containerable> List<PrismContainerValue<T>> toPcvList(List<T> beans)
-
setImmutable
void setImmutable(boolean immutable)
- Specified by:
setImmutable
in interfacePrismValue
-
getRealClass
Class<?> getRealClass()
- Specified by:
getRealClass
in interfacePrismValue
-
getRealValue
@NotNull <T> T getRealValue()
- Specified by:
getRealValue
in interfacePrismValue
-
asSingleValuedContainer
PrismContainer<C> asSingleValuedContainer(@NotNull QName itemName) throws SchemaException
Returns a single-valued container (with a single-valued definition) holding just this value.- Parameters:
itemName
- Item name for newly-created container.- Returns:
- Throws:
SchemaException
-
mergeContent
void mergeContent(@NotNull PrismContainerValue<?> other, @NotNull List<QName> overwrite) throws SchemaException
- Throws:
SchemaException
-
getRootValue
PrismContainerValue<?> getRootValue()
- Specified by:
getRootValue
in interfacePrismValue
-
asPrismContainerValues
static <C extends Containerable> List<PrismContainerValue<C>> asPrismContainerValues(List<C> containerables)
-
asContainerables
static <C extends Containerable> List<C> asContainerables(List<PrismContainerValue<C>> pcvs)
-
asContainerables
static <C extends Containerable> Collection<C> asContainerables(Collection<PrismContainerValue<C>> pcvs)
-
setOriginTypeRecursive
void setOriginTypeRecursive(OriginType originType)
Set origin type to all values and subvalues
-
keepPaths
void keepPaths(List<? extends ItemPath> keep) throws SchemaException
- Throws:
SchemaException
-
removePaths
void removePaths(List<? extends ItemPath> remove) throws SchemaException
- Throws:
SchemaException
-
getAllValues
@NotNull Collection<PrismValue> getAllValues(ItemPath path)
- Specified by:
getAllValues
in interfacePrismValue
-
removeOperationalItems
void removeOperationalItems()
-
getDefinition
PrismContainerDefinition<C> getDefinition()
-
acceptParentVisitor
void acceptParentVisitor(Visitor visitor)
- Specified by:
acceptParentVisitor
in interfaceParentVisitable
-
hasNoItems
boolean hasNoItems()
Like isEmpty but ignores presence of container value ID.
-
-