Package com.evolveum.midpoint.prism.impl
Class PrismContainerValueImpl<C extends Containerable>
- java.lang.Object
-
- com.evolveum.midpoint.prism.AbstractFreezable
-
- com.evolveum.midpoint.prism.impl.PrismValueImpl
-
- com.evolveum.midpoint.prism.impl.PrismContainerValueImpl<C>
-
- All Implemented Interfaces:
Freezable
,ItemDefinitionTransformer.TransformableValue
,MidpointOriginMetadata
,ParentVisitable
,PathVisitable
,PrismContainerValue<C>
,PrismContextSensitive
,PrismValue
,Revivable
,Visitable
,DebugDumpable
,Serializable
- Direct Known Subclasses:
PrismObjectValueImpl
public class PrismContainerValueImpl<C extends Containerable> extends PrismValueImpl implements PrismContainerValue<C>
- Author:
- semancik
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.PrismContainerValue
PrismContainerValue.RemovedItemDefinitionException
-
-
Field Summary
Fields Modifier and Type Field Description protected ComplexTypeDefinition
complexTypeDefinition
static RuntimeException
DIFFERENT_ITEMS_EXCEPTION
protected LinkedHashMap<QName,Item<?,?>>
items
protected Set<String>
unqualifiedItemNames
-
Fields inherited from class com.evolveum.midpoint.prism.impl.PrismValueImpl
defaultEquivalenceStrategy
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description PrismContainerValueImpl()
PrismContainerValueImpl(C containerable)
PrismContainerValueImpl(OriginType type, Objectable source, PrismContainerable container, Long id, ComplexTypeDefinition complexTypeDefinition, PrismContext prismContext)
PrismContainerValueImpl(PrismContext prismContext)
PrismContainerValueImpl(C containerable, PrismContext prismContext)
-
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(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(@NotNull PrismContainerDefinition<C> containerDef, boolean force)
void
applyDefinition(ItemDefinition definition, 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, Supplier<String> sourceDescriptionSupplier)
void
assertDefinitions(Supplier<String> sourceDescriptionSupplier)
PrismContainer<C>
asSingleValuedContainer(@NotNull 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.PrismContainerValueImpl<C>
cloneComplex(CloneStrategy strategy)
Complex clone with different cloning strategies.boolean
contains(Item item)
boolean
contains(ItemName itemName)
boolean
containsItem(ItemPath path, boolean acceptEmptyItem)
static <C extends Containerable>
booleancontainsRealValue(Collection<PrismContainerValue<C>> cvalCollection, PrismContainerValue<C> cval)
protected void
copyValues(CloneStrategy strategy, PrismContainerValueImpl<C> clone)
<IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>>
IcreateDetachedSubItem(QName name, Class<I> type, ID itemDefinition, boolean immutable)
PrismContainerValue<C>
createImmutableClone()
<X> PrismProperty<X>
createProperty(PrismPropertyDefinition propertyDefinition)
<X> PrismProperty<X>
createProperty(QName propertyName)
String
debugDump(int indent)
protected void
debugDumpIdentifiers(StringBuilder sb)
boolean
deleteRawElement(Object element)
protected void
detailedDebugDumpStart(StringBuilder sb)
boolean
diffMatchingRepresentation(PrismValue otherValue, Collection<? extends ItemDelta> deltas, ParameterizedEquivalenceStrategy strategy, boolean exitOnDiff)
boolean
equals(PrismValue other, @NotNull ParameterizedEquivalenceStrategy strategy)
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)
<IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>>
IfindItem(ItemPath itemPath, 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)
@NotNull Collection<Item<?,?>>
getAllItems(@NotNull ItemPath path)
@NotNull Collection<PrismValue>
getAllValues(ItemPath path)
Class<C>
getCompileTimeClass()
@Nullable ComplexTypeDefinition
getComplexTypeDefinition()
PrismContainer<C>
getContainer()
PrismContainerDefinition<C>
getDefinition()
Long
getId()
Object
getIdentifier()
Returns the value of identifier corresponding to the '#' path: container id or object oid.@NotNull Collection<QName>
getItemNames()
@NotNull Collection<Item<?,?>>
getItems()
Returns a set of items that the property container contains.<I extends Item<?,?>>
List<I>getItems(Class<I> type)
PrismContainerable<C>
getParent()
@NotNull ItemPath
getPath()
protected Object
getPathComponent()
PrismContext
getPrismContext()
PrismContext
getPrismContextLocal()
@NotNull 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()
Returns the statically-typed "real value".PrismContainerValue<?>
getRootValue()
QName
getTypeName()
C
getValue()
boolean
hasCompleteDefinition()
Returns true if all contained items have complete definitions.int
hashCode(@NotNull ParameterizedEquivalenceStrategy strategy)
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(@NotNull PrismContainerValue<?> other, @NotNull List<QName> overwrite)
void
normalize()
Currently doing nothing.void
performFreeze()
void
recompute(PrismContext prismContext)
<IV extends PrismValue,ID extends ItemDefinition<?>>
voidremove(@NotNull 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)
boolean
representsSameValue(PrismValue other, boolean lax)
Returns true if this and other value represent the same value.void
revive(PrismContext prismContext)
TODO: Is revive necessary if prism context is static? TODO document (if it's found to be necessary)void
setId(Long id)
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()
void
transformDefinition(ComplexTypeDefinition parentDef, ItemDefinition<?> itemDef, ItemDefinitionTransformer transformation)
-
Methods inherited from class com.evolveum.midpoint.prism.impl.PrismValueImpl
appendOriginDump, applyDefinition, clearParent, copyValues, diff, diffMatchingRepresentation, equals, equals, getOriginObject, getOriginType, getParentContainerValue, getUserData, getUserData, getValueMetadata, hashCode, hashCode, hasValueMetadata, isTransient, recompute, setOriginObject, setOriginType, setParent, setPrismContext, setTransient, setUserData, setValueMetadata, setValueMetadata, setValueMetadata
-
Methods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutable
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
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.PrismContainerValue
findItem, getItemRealValue
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismValue
applyDefinition, clearParent, diff, equals, getParentContainerValue, getRealValueOrRawType, getUserData, getUserData, getValueMetadata, getValueMetadataAsContainer, hashCode, hasRealClass, hasValueMetadata, isTransient, recompute, setParent, setPrismContext, setTransient, setUserData, setValueMetadata, setValueMetadata, setValueMetadata, valueMetadata
-
-
-
-
Field Detail
-
DIFFERENT_ITEMS_EXCEPTION
public static final RuntimeException DIFFERENT_ITEMS_EXCEPTION
-
items
protected final LinkedHashMap<QName,Item<?,?>> items
-
complexTypeDefinition
protected ComplexTypeDefinition complexTypeDefinition
-
-
Constructor Detail
-
PrismContainerValueImpl
public PrismContainerValueImpl()
-
PrismContainerValueImpl
public PrismContainerValueImpl(C containerable)
-
PrismContainerValueImpl
public PrismContainerValueImpl(PrismContext prismContext)
-
PrismContainerValueImpl
public PrismContainerValueImpl(C containerable, PrismContext prismContext)
-
PrismContainerValueImpl
public PrismContainerValueImpl(OriginType type, Objectable source, PrismContainerable container, Long id, ComplexTypeDefinition complexTypeDefinition, PrismContext prismContext)
-
-
Method Detail
-
asContainerable
public static <T extends Containerable> T asContainerable(PrismContainerValue<T> value)
-
getPrismContext
public PrismContext getPrismContext()
- Specified by:
getPrismContext
in interfacePrismContextSensitive
- Overrides:
getPrismContext
in classPrismValueImpl
-
getPrismContextLocal
public PrismContext getPrismContextLocal()
- Specified by:
getPrismContextLocal
in interfacePrismContainerValue<C extends Containerable>
-
getItems
@NotNull public @NotNull Collection<Item<?,?>> getItems()
Returns a set of items that the property container contains. The items may be properties or inner property containers.The set may be null. In case there are no properties an empty set is returned.
Returned set is mutable. Live object is returned.
- Specified by:
getItems
in interfacePrismContainerValue<C extends Containerable>
- Returns:
- set of items that the property container contains.
-
size
public int size()
- Specified by:
size
in interfacePrismContainerValue<C extends Containerable>
-
getProperties
@NotNull public @NotNull Set<PrismProperty<?>> getProperties()
Returns a set of properties that the property container contains.The set must not be null. In case there are no properties an empty set is returned.
Returned set is immutable! Any change to it will be ignored.
- Specified by:
getProperties
in interfacePrismContainerValue<C extends Containerable>
- Returns:
- set of properties that the property container contains.
-
getId
public Long getId()
- Specified by:
getId
in interfacePrismContainerValue<C extends Containerable>
-
setId
public void setId(Long id)
- Specified by:
setId
in interfacePrismContainerValue<C extends Containerable>
-
getParent
public PrismContainerable<C> getParent()
- Specified by:
getParent
in interfacePrismContainerValue<C extends Containerable>
- Specified by:
getParent
in interfacePrismValue
- Overrides:
getParent
in classPrismValueImpl
-
getContainer
public PrismContainer<C> getContainer()
- Specified by:
getContainer
in interfacePrismContainerValue<C extends Containerable>
-
getPath
@NotNull public @NotNull ItemPath getPath()
- Specified by:
getPath
in interfacePrismValue
- Overrides:
getPath
in classPrismValueImpl
-
getPathComponent
protected Object getPathComponent()
- Overrides:
getPathComponent
in classPrismValueImpl
-
getValue
public C getValue()
- Specified by:
getValue
in interfacePrismContainerValue<C extends Containerable>
-
asContainerable
@NotNull public C asContainerable()
- Specified by:
asContainerable
in interfacePrismContainerValue<C extends Containerable>
-
getCompileTimeClass
public Class<C> getCompileTimeClass()
- Specified by:
getCompileTimeClass
in interfacePrismContainerValue<C extends Containerable>
-
canRepresent
public boolean canRepresent(Class<?> clazz)
- Specified by:
canRepresent
in interfacePrismContainerValue<C extends Containerable>
-
asContainerable
public C asContainerable(Class<C> requiredClass)
- Specified by:
asContainerable
in interfacePrismContainerValue<C extends Containerable>
-
getItemNames
@NotNull public @NotNull Collection<QName> getItemNames()
- Specified by:
getItemNames
in interfacePrismContainerValue<C extends Containerable>
-
add
public <IV extends PrismValue,ID extends ItemDefinition<?>> void add(Item<IV,ID> item) throws SchemaException
- Specified by:
add
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
add
public <IV extends PrismValue,ID extends ItemDefinition<?>> void add(Item<IV,ID> item, boolean checkUniqueness) throws SchemaException
Adds an item to a property container.- Specified by:
add
in interfacePrismContainerValue<C extends Containerable>
- Parameters:
item
- item to add.- Throws:
IllegalArgumentException
- an attempt to add value that already existsSchemaException
-
merge
public <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.- Specified by:
merge
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
subtract
public <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.- Specified by:
subtract
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
addReplaceExisting
public <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.- Specified by:
addReplaceExisting
in interfacePrismContainerValue<C extends Containerable>
- Parameters:
item
- item to add.- Throws:
SchemaException
-
remove
public <IV extends PrismValue,ID extends ItemDefinition<?>> void remove(@NotNull @NotNull Item<IV,ID> item)
- Specified by:
remove
in interfacePrismContainerValue<C extends Containerable>
-
removeAll
public void removeAll()
- Specified by:
removeAll
in interfacePrismContainerValue<C extends Containerable>
-
addAll
public void addAll(Collection<? extends Item<?,?>> itemsToAdd) throws SchemaException
Adds a collection of items to a property container.- Specified by:
addAll
in interfacePrismContainerValue<C extends Containerable>
- Parameters:
itemsToAdd
- items to add- Throws:
IllegalArgumentException
- an attempt to add value that already existsSchemaException
-
addAllReplaceExisting
public void addAllReplaceExisting(Collection<? extends Item<?,?>> itemsToAdd) throws SchemaException
Adds a collection of items to a property container. Existing values will be replaced.- Specified by:
addAllReplaceExisting
in interfacePrismContainerValue<C extends Containerable>
- Parameters:
itemsToAdd
- items to add- Throws:
SchemaException
-
replace
public <IV extends PrismValue,ID extends ItemDefinition<?>> void replace(Item<IV,ID> oldItem, Item<IV,ID> newItem) throws SchemaException
- Specified by:
replace
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
clear
public void clear()
- Specified by:
clear
in interfacePrismContainerValue<C extends Containerable>
-
contains
public boolean contains(Item item)
- Specified by:
contains
in interfacePrismContainerValue<C extends Containerable>
-
contains
public boolean contains(ItemName itemName)
- Specified by:
contains
in interfacePrismContainerValue<C extends Containerable>
-
containsRealValue
public static <C extends Containerable> boolean containsRealValue(Collection<PrismContainerValue<C>> cvalCollection, PrismContainerValue<C> cval)
-
find
public Object find(ItemPath path)
- Specified by:
find
in interfacePrismValue
-
findPartial
public <IV extends PrismValue,ID extends ItemDefinition<?>> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path)
- Specified by:
findPartial
in interfacePrismContainerValue<C extends Containerable>
-
findProperty
public <X> PrismProperty<X> findProperty(ItemPath propertyPath)
- Specified by:
findProperty
in interfacePrismContainerValue<C extends Containerable>
-
findProperty
public <X> PrismProperty<X> findProperty(PrismPropertyDefinition<X> propertyDefinition)
Finds a specific property in the container by definition.Returns null if nothing is found.
- Specified by:
findProperty
in interfacePrismContainerValue<C extends Containerable>
- Parameters:
propertyDefinition
- property definition to find.- Returns:
- found property or null
-
findContainer
public <X extends Containerable> PrismContainer<X> findContainer(QName containerName)
- Specified by:
findContainer
in interfacePrismContainerValue<C extends Containerable>
-
findReference
public PrismReference findReference(QName elementName)
- Specified by:
findReference
in interfacePrismContainerValue<C extends Containerable>
-
findReferenceByCompositeObjectElementName
public PrismReference findReferenceByCompositeObjectElementName(QName elementName)
- Specified by:
findReferenceByCompositeObjectElementName
in interfacePrismContainerValue<C extends Containerable>
-
findItem
public <IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>> I findItem(ItemPath itemPath, Class<I> type)
- Specified by:
findItem
in interfacePrismContainerValue<C extends Containerable>
-
findItem
public <IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>> I findItem(ItemDefinition itemDefinition, Class<I> type)
- Specified by:
findItem
in interfacePrismContainerValue<C extends Containerable>
-
containsItem
public boolean containsItem(ItemPath path, boolean acceptEmptyItem) throws SchemaException
- Specified by:
containsItem
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
createDetachedSubItem
public <IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>> I createDetachedSubItem(QName name, Class<I> type, ID itemDefinition, boolean immutable) throws SchemaException, PrismContainerValue.RemovedItemDefinitionException
- Specified by:
createDetachedSubItem
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
PrismContainerValue.RemovedItemDefinitionException
-
findOrCreateContainer
public <T extends Containerable> PrismContainer<T> findOrCreateContainer(QName containerName) throws SchemaException
- Specified by:
findOrCreateContainer
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
findOrCreateReference
public PrismReference findOrCreateReference(QName referenceName) throws SchemaException
- Specified by:
findOrCreateReference
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
findOrCreateItem
public <IV extends PrismValue,ID extends ItemDefinition<?>> Item<IV,ID> findOrCreateItem(QName containerName) throws SchemaException
- Specified by:
findOrCreateItem
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
findOrCreateItem
public <IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>> I findOrCreateItem(QName containerName, Class<I> type) throws SchemaException
- Specified by:
findOrCreateItem
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
findOrCreateItem
public <IV extends PrismValue,ID extends ItemDefinition<?>,I extends Item<IV,ID>> I findOrCreateItem(ItemPath path, Class<I> type, ID definition) throws SchemaException
- Specified by:
findOrCreateItem
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
findOrCreateProperty
public <X> PrismProperty<X> findOrCreateProperty(ItemPath propertyPath) throws SchemaException
- Specified by:
findOrCreateProperty
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
findOrCreateProperty
public <X> PrismProperty<X> findOrCreateProperty(PrismPropertyDefinition propertyDef) throws SchemaException
- Specified by:
findOrCreateProperty
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
createProperty
public <X> PrismProperty<X> createProperty(QName propertyName) throws SchemaException
- Specified by:
createProperty
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
createProperty
public <X> PrismProperty<X> createProperty(PrismPropertyDefinition propertyDefinition) throws SchemaException
- Specified by:
createProperty
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
removeProperty
public void removeProperty(ItemPath path)
- Specified by:
removeProperty
in interfacePrismContainerValue<C extends Containerable>
-
removeContainer
public void removeContainer(ItemPath path)
- Specified by:
removeContainer
in interfacePrismContainerValue<C extends Containerable>
-
removeReference
public void removeReference(ItemPath path)
- Specified by:
removeReference
in interfacePrismContainerValue<C extends Containerable>
-
setPropertyRealValue
public <T> void setPropertyRealValue(QName propertyName, T realValue, PrismContext prismContext) throws SchemaException
- Specified by:
setPropertyRealValue
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
getPropertyRealValue
public <T> T getPropertyRealValue(QName propertyName, Class<T> type)
- Specified by:
getPropertyRealValue
in interfacePrismContainerValue<C extends Containerable>
-
recompute
public void recompute(PrismContext prismContext)
- Specified by:
recompute
in interfacePrismContainerValue<C extends Containerable>
- Specified by:
recompute
in interfacePrismValue
- Specified by:
recompute
in classPrismValueImpl
-
accept
public void accept(Visitor visitor)
- Specified by:
accept
in interfacePrismContainerValue<C extends Containerable>
- Specified by:
accept
in interfacePrismValue
- Specified by:
accept
in interfaceVisitable<C extends Containerable>
- Overrides:
accept
in classPrismValueImpl
-
accept
public void accept(Visitor visitor, ItemPath path, boolean recursive)
- Specified by:
accept
in interfacePathVisitable
- Specified by:
accept
in interfacePrismContainerValue<C extends Containerable>
- Specified by:
accept
in interfacePrismValue
- Overrides:
accept
in classPrismValueImpl
-
acceptParentVisitor
public void acceptParentVisitor(Visitor visitor)
- Specified by:
acceptParentVisitor
in interfaceParentVisitable
- Specified by:
acceptParentVisitor
in interfacePrismContainerValue<C extends Containerable>
-
hasCompleteDefinition
public boolean hasCompleteDefinition()
Description copied from interface:PrismContainerValue
Returns true if all contained items have complete definitions. (Currently does not check the definition of this value itself.)- Specified by:
hasCompleteDefinition
in interfacePrismContainerValue<C extends Containerable>
-
representsSameValue
public boolean representsSameValue(PrismValue other, boolean lax)
Description copied from interface:PrismValue
Returns true if this and other value represent the same value. E.g. if they have the same IDs, OIDs or it is otherwise know that they "belong together" without a deep examination of the values.- Specified by:
representsSameValue
in interfacePrismValue
- Overrides:
representsSameValue
in classPrismValueImpl
lax
- If we can reasonably assume that the two values belong together even if they don't have the same ID, e.g. if they both belong to single-valued parent items. This is useful e.g. when comparing multi-valued containers. But can cause problems when we want to be sure we are removing the correct value.
-
diffMatchingRepresentation
public boolean diffMatchingRepresentation(PrismValue otherValue, Collection<? extends ItemDelta> deltas, ParameterizedEquivalenceStrategy strategy, boolean exitOnDiff)
- Overrides:
diffMatchingRepresentation
in classPrismValueImpl
-
isRaw
public boolean isRaw()
- Specified by:
isRaw
in interfacePrismValue
-
addRawElement
public boolean addRawElement(Object element) throws SchemaException
- Specified by:
addRawElement
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
deleteRawElement
public boolean deleteRawElement(Object element) throws SchemaException
- Specified by:
deleteRawElement
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
removeRawElement
public boolean removeRawElement(Object element)
- Specified by:
removeRawElement
in interfacePrismContainerValue<C extends Containerable>
-
getDefinition
public PrismContainerDefinition<C> getDefinition()
- Specified by:
getDefinition
in interfacePrismContainerValue<C extends Containerable>
- Overrides:
getDefinition
in classPrismValueImpl
-
applyDefinition
public void applyDefinition(ItemDefinition definition, boolean force) throws SchemaException
- Specified by:
applyDefinition
in interfacePrismContainerValue<C extends Containerable>
- Specified by:
applyDefinition
in interfacePrismValue
- Overrides:
applyDefinition
in classPrismValueImpl
- Throws:
SchemaException
-
applyDefinition
public void applyDefinition(@NotNull @NotNull PrismContainerDefinition<C> containerDef, boolean force) throws SchemaException
- Specified by:
applyDefinition
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
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)- Specified by:
revive
in interfaceRevivable
- Overrides:
revive
in classPrismValueImpl
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacePrismValue
-
hasNoItems
public boolean hasNoItems()
Description copied from interface:PrismContainerValue
Like isEmpty but ignores presence of container value ID.- Specified by:
hasNoItems
in interfacePrismContainerValue<C extends Containerable>
-
isIdOnly
public boolean isIdOnly()
- Specified by:
isIdOnly
in interfacePrismContainerValue<C extends Containerable>
-
normalize
public void normalize()
Description copied from interface:PrismValue
Currently doing nothing.- Specified by:
normalize
in interfacePrismValue
- Overrides:
normalize
in classPrismValueImpl
-
checkConsistenceInternal
public void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
- Specified by:
checkConsistenceInternal
in interfacePrismValue
- Specified by:
checkConsistenceInternal
in classPrismValueImpl
-
assertDefinitions
public void assertDefinitions(Supplier<String> sourceDescriptionSupplier) throws SchemaException
- Specified by:
assertDefinitions
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
assertDefinitions
public void assertDefinitions(boolean tolerateRaw, Supplier<String> sourceDescriptionSupplier) throws SchemaException
- Specified by:
assertDefinitions
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
clone
public PrismContainerValue<C> clone()
Description copied from class:PrismValueImpl
Literal clone.- Specified by:
clone
in interfacePrismContainerValue<C extends Containerable>
- Specified by:
clone
in interfacePrismValue
- Specified by:
clone
in classPrismValueImpl
-
createImmutableClone
public PrismContainerValue<C> createImmutableClone()
- Specified by:
createImmutableClone
in interfacePrismContainerValue<C extends Containerable>
- Specified by:
createImmutableClone
in interfacePrismValue
- Overrides:
createImmutableClone
in classPrismValueImpl
-
cloneComplex
public PrismContainerValueImpl<C> cloneComplex(CloneStrategy strategy)
Description copied from class:PrismValueImpl
Complex clone with different cloning strategies.- Specified by:
cloneComplex
in interfacePrismContainerValue<C extends Containerable>
- Specified by:
cloneComplex
in interfacePrismValue
- Specified by:
cloneComplex
in classPrismValueImpl
- See Also:
CloneStrategy
-
copyValues
protected void copyValues(CloneStrategy strategy, PrismContainerValueImpl<C> clone)
-
equals
public boolean equals(PrismValue other, @NotNull @NotNull ParameterizedEquivalenceStrategy strategy)
- Specified by:
equals
in interfacePrismValue
- Overrides:
equals
in classPrismValueImpl
-
equivalent
public boolean equivalent(PrismContainerValue<?> other)
- Specified by:
equivalent
in interfacePrismContainerValue<C extends Containerable>
-
hashCode
public int hashCode(@NotNull @NotNull ParameterizedEquivalenceStrategy strategy)
- Specified by:
hashCode
in interfacePrismValue
- Overrides:
hashCode
in classPrismValueImpl
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
-
debugDumpIdentifiers
protected void debugDumpIdentifiers(StringBuilder sb)
-
detailedDebugDumpStart
protected void detailedDebugDumpStart(StringBuilder sb)
-
toHumanReadableString
public String toHumanReadableString()
- Specified by:
toHumanReadableString
in interfacePrismValue
- Specified by:
toHumanReadableString
in classPrismValueImpl
-
getTypeName
public QName getTypeName()
- Specified by:
getTypeName
in interfacePrismValue
- Overrides:
getTypeName
in classPrismValueImpl
-
getComplexTypeDefinition
@Nullable public @Nullable ComplexTypeDefinition getComplexTypeDefinition()
- Specified by:
getComplexTypeDefinition
in interfacePrismContainerValue<C extends Containerable>
-
toPcvList
public static <T extends Containerable> List<PrismContainerValue<T>> toPcvList(List<T> beans)
-
performFreeze
public void performFreeze()
- Overrides:
performFreeze
in classPrismValueImpl
-
getRealClass
public Class<?> getRealClass()
- Specified by:
getRealClass
in interfacePrismValue
- Specified by:
getRealClass
in classPrismValueImpl
-
getRealValue
@NotNull public <T> T getRealValue()
Description copied from interface:PrismValue
Returns the statically-typed "real value". TODO specify when exactly the returned value can be null. TODO decide for containers: they throw an exception if the value is not statically typed.- Specified by:
getRealValue
in interfacePrismValue
- Specified by:
getRealValue
in classPrismValueImpl
-
asSingleValuedContainer
public PrismContainer<C> asSingleValuedContainer(@NotNull @NotNull QName itemName) throws SchemaException
Returns a single-valued container (with a single-valued definition) holding just this value.- Specified by:
asSingleValuedContainer
in interfacePrismContainerValue<C extends Containerable>
- Parameters:
itemName
- Item name for newly-created container.- Throws:
SchemaException
-
mergeContent
@Experimental public void mergeContent(@NotNull @NotNull PrismContainerValue<?> other, @NotNull @NotNull List<QName> overwrite) throws SchemaException
- Specified by:
mergeContent
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
getRootValue
public PrismContainerValue<?> getRootValue()
- Specified by:
getRootValue
in interfacePrismContainerValue<C extends Containerable>
- Specified by:
getRootValue
in interfacePrismValue
- Overrides:
getRootValue
in classPrismValueImpl
-
asPrismContainerValues
public static <C extends Containerable> List<PrismContainerValue<C>> asPrismContainerValues(List<C> containerables)
-
asContainerables
public static <C extends Containerable> List<C> asContainerables(List<PrismContainerValue<C>> pcvs)
-
asContainerables
public static <C extends Containerable> Collection<C> asContainerables(Collection<PrismContainerValue<C>> pcvs)
-
setOriginTypeRecursive
public void setOriginTypeRecursive(OriginType originType)
Set origin type to all values and subvalues- Specified by:
setOriginTypeRecursive
in interfacePrismContainerValue<C extends Containerable>
-
keepPaths
public void keepPaths(List<? extends ItemPath> keep) throws SchemaException
- Specified by:
keepPaths
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
removePaths
public void removePaths(List<? extends ItemPath> remove) throws SchemaException
- Specified by:
removePaths
in interfacePrismContainerValue<C extends Containerable>
- Throws:
SchemaException
-
getAllValues
@NotNull public @NotNull Collection<PrismValue> getAllValues(ItemPath path)
Description copied from interface:PrismValue
- Specified by:
getAllValues
in interfacePrismValue
- Overrides:
getAllValues
in classPrismValueImpl
-
getAllItems
@NotNull public @NotNull Collection<Item<?,?>> getAllItems(@NotNull @NotNull ItemPath path)
Description copied from interface:PrismValue
SeeItem.getAllItems(ItemPath)
. Here the path is never empty.- Specified by:
getAllItems
in interfacePrismValue
- Overrides:
getAllItems
in classPrismValueImpl
-
getIdentifier
public Object getIdentifier()
Returns the value of identifier corresponding to the '#' path: container id or object oid.
-
removeItems
public void removeItems(List<? extends ItemPath> itemsToRemove)
- Specified by:
removeItems
in interfacePrismContainerValue<C extends Containerable>
-
removeOperationalItems
public void removeOperationalItems()
- Specified by:
removeOperationalItems
in interfacePrismContainerValue<C extends Containerable>
-
transformDefinition
public void transformDefinition(ComplexTypeDefinition parentDef, ItemDefinition<?> itemDef, ItemDefinitionTransformer transformation)
- Specified by:
transformDefinition
in interfaceItemDefinitionTransformer.TransformableValue
-
-