Class DummyContainerImpl<C extends Containerable>
java.lang.Object
com.evolveum.midpoint.prism.impl.item.DummyItem<PrismContainerValue<C>,PrismContainerDefinition<C>,PrismContainer<C>>
com.evolveum.midpoint.prism.impl.item.DummyContainerImpl<C>
- All Implemented Interfaces:
Freezable
,Item<PrismContainerValue<C>,
,PrismContainerDefinition<C>> Itemable
,ParentVisitable
,PathVisitable
,PrismContainer<C>
,PrismContainerable<C>
,PrismContextSensitive
,Revivable
,Visitable
,DebugDumpable
,Serializable
public class DummyContainerImpl<C extends Containerable>
extends DummyItem<PrismContainerValue<C>,PrismContainerDefinition<C>,PrismContainer<C>>
implements PrismContainer<C>
- Author:
- semancik
- See Also:
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Convenience method.void
addIgnoringEquivalents
(@NotNull PrismContainerValue<C> newValue) Adds a value, not looking for equivalent values.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).clone()
Literal clone.cloneComplex
(CloneStrategy strategy) Complex clone with different cloning strategies.boolean
containsItem
(ItemPath itemPath, boolean acceptEmptyItem) Creates specific subclass of ItemDelta appropriate for type of item that this definition represents (e.g.createDelta
(ItemPath path) deepCloneDefinition
(@NotNull DeepCloneOperation operation) diff
(PrismContainer<C> other) diff
(PrismContainer<C> other, ParameterizedEquivalenceStrategy strategy) diffModifications
(PrismContainer<C> other, ParameterizedEquivalenceStrategy strategy) boolean
equivalent
(Object obj) This method ignores some part of the object during comparison (e.g.<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> <IV extends PrismValue,
ID extends ItemDefinition<?>, I extends Item<IV, ID>>
I<IV extends PrismValue,
ID extends ItemDefinition<?>, I extends Item<IV, ID>>
I<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) findOrCreateReference
(ItemPath propertyPath) <IV extends PrismValue,
ID extends ItemDefinition<?>>
PartiallyResolvedItem<IV,ID> findPartial
(ItemPath path) <T> PrismProperty<T>
findProperty
(ItemPath path) findReference
(ItemPath path) findValue
(long id) Returns the static type of data represented by values of this container, if known and applicable.getHelp()
Returns help message defined for the item.<T> T
getPropertyRealValue
(ItemPath propertyPath, Class<T> type) 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<C>
Returns (potentially empty) collection of "real values".<X> X[]
getRealValuesArray
(Class<X> type) Type override, also for compatibility.@NotNull PrismContainerValue<C>
getValue()
Returns the value, if there is only one.void
mergeValue
(PrismContainerValue<C> otherValue) void
mergeValues
(PrismContainer<C> other) void
mergeValues
(Collection<PrismContainerValue<C>> otherValues) void
Convenience method.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) <C extends Containerable>
voidsetContainerRealValue
(QName containerName, C realValue) <T> void
setPropertyRealValue
(QName propertyName, T realValue) <T> void
setPropertyRealValues
(QName propertyName, T... realValues) void
setRealValue
(C value) void
setValue
(@NotNull PrismContainerValue<C> value) 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 com.evolveum.midpoint.prism.impl.item.DummyItem
accept, accept, acceptParentVisitor, add, addAll, addRespectingMetadataAndCloning, applyDefinition, applyDefinition, assertDefinitions, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistenceInternal, clear, debugDump, delegate, diff, equals, equals, equals, find, freeze, getAllItems, getAllValues, getDefinition, getDisplayName, getElementName, getHighestId, getParent, getPath, getPrismContext, getPrismContextLocal, getUserData, getUserData, getValues, hasCompleteDefinition, hashCode, hashCode, hashCode, isEmpty, isImmutable, isIncomplete, merge, normalize, recomputeAllValues, remove, removeAll, removeRespectingMetadata, replace, replaceAll, revive, setDefinition, setElementName, setIncomplete, setParent, setPrismContext, setUserData, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
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.Item
acceptParentVisitor, add, add, addAll, addAll, addRespectingMetadataAndCloning, applyDefinition, assertDefinitions, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistenceInternal, clear, contains, contains, copy, diff, diff, equals, equals, equals, filterValues, filterYields, find, findValue, findValue, getAllItems, getAllValues, getAnyValue, getAnyValue, getClonedValues, getDisplayName, getElementName, getHighestId, getParent, getPath, getPrismContextLocal, getRealValuesOrRawTypes, getUserData, getUserData, hasAnyValue, hasCompleteDefinition, hashCode, hashCode, hashCode, hasNoValues, hasRaw, isEmpty, isIncomplete, isOperational, isRaw, isSingleValue, isSingleValueByDefinition, merge, normalize, recomputeAllValues, remove, remove, removeAll, removeIf, removeRespectingMetadata, replace, replaceAll, setElementName, setIncomplete, setParent, setPrismContext, setUserData, size, valuesStream
Methods inherited from interface com.evolveum.midpoint.prism.PrismContainer
accept, applyDefinition, getDefinition, getValues, setDefinition
Methods inherited from interface com.evolveum.midpoint.prism.PrismContainerable
getComplexTypeDefinition
Methods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContext
-
Constructor Details
-
DummyContainerImpl
-
-
Method Details
-
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<C extends Containerable>
- Specified by:
getCompileTimeClass
in interfacePrismContainerable<C extends Containerable>
-
canRepresent
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<C extends Containerable>
-
canRepresent
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<C extends Containerable>
-
getRealValues
Description copied from interface:Item
Returns (potentially empty) collection of "real values".- Specified by:
getRealValues
in interfaceItem<PrismContainerValue<C extends Containerable>,
PrismContainerDefinition<C extends Containerable>> - Specified by:
getRealValues
in interfacePrismContainer<C extends 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.
-
addIgnoringEquivalents
public void addIgnoringEquivalents(@NotNull @NotNull PrismContainerValue<C> 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<C extends Containerable>,
PrismContainerDefinition<C extends Containerable>> - Throws:
SchemaException
-
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<C extends Containerable>,
PrismContainerDefinition<C extends Containerable>> - Specified by:
getRealValue
in interfacePrismContainer<C extends Containerable>
-
setRealValue
- Specified by:
setRealValue
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
getRealValue
Description copied from interface:Item
Type override, also for compatibility.- Specified by:
getRealValue
in interfaceItem<PrismContainerValue<C extends Containerable>,
PrismContainerDefinition<C extends Containerable>>
-
getRealValuesArray
Description copied from interface:Item
Type override, also for compatibility.- Specified by:
getRealValuesArray
in interfaceItem<PrismContainerValue<C extends Containerable>,
PrismContainerDefinition<C extends Containerable>>
-
setValue
- Specified by:
setValue
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
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<C extends Containerable>,
PrismContainerDefinition<C extends Containerable>> - Specified by:
getValue
in interfacePrismContainer<C extends Containerable>
-
getValue
- Specified by:
getValue
in interfacePrismContainer<C extends Containerable>
-
setPropertyRealValue
- Specified by:
setPropertyRealValue
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
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<C extends Containerable>,
PrismContainerDefinition<C extends Containerable>> - Returns:
- help message for the item
-
setContainerRealValue
public <C extends Containerable> void setContainerRealValue(QName containerName, C realValue) throws SchemaException - Specified by:
setContainerRealValue
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
setPropertyRealValues
- Specified by:
setPropertyRealValues
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
getPropertyRealValue
- Specified by:
getPropertyRealValue
in interfacePrismContainer<C extends Containerable>
-
add
Description copied from interface:PrismContainer
Convenience method. Works only on single-valued containers.- Specified by:
add
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
createNewValue
- Specified by:
createNewValue
in interfacePrismContainer<C extends Containerable>
-
mergeValues
- Specified by:
mergeValues
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
mergeValues
- Specified by:
mergeValues
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
mergeValue
- Specified by:
mergeValue
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
trim
public void trim()Description copied from interface:PrismContainer
Remove all empty values- Specified by:
trim
in interfacePrismContainer<C extends Containerable>
-
findItem
public <IV extends PrismValue,ID extends ItemDefinition<?>, I findItemI extends Item<IV, ID>> (QName itemQName, Class<I> type) - Specified by:
findItem
in interfacePrismContainer<C extends Containerable>
-
findPartial
public <IV extends PrismValue,ID extends ItemDefinition<?>> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path) - Specified by:
findPartial
in interfaceItem<PrismContainerValue<C extends Containerable>,
PrismContainerDefinition<C extends Containerable>> - Specified by:
findPartial
in interfacePrismContainer<C extends Containerable>
-
findCreateItem
public <IV extends PrismValue,ID extends ItemDefinition<?>, I findCreateItemI extends Item<IV, ID>> (QName itemQName, Class<I> type, boolean create) throws SchemaException - Specified by:
findCreateItem
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
findItem
public <IV extends PrismValue,ID extends ItemDefinition<?>, I findItemI extends Item<IV, ID>> (ItemPath path, Class<I> type) - Specified by:
findItem
in interfacePrismContainer<C extends Containerable>
-
findItem
- Specified by:
findItem
in interfacePrismContainer<C extends Containerable>
-
containsItem
- Specified by:
containsItem
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
findCreateItem
public <IV extends PrismValue,ID extends ItemDefinition<?>, I findCreateItemI extends Item<IV, ID>> (ItemPath itemPath, Class<I> type, ID itemDefinition, boolean create) throws SchemaException - Specified by:
findCreateItem
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
findValue
- Specified by:
findValue
in interfacePrismContainer<C extends Containerable>
-
findContainer
- Specified by:
findContainer
in interfacePrismContainer<C extends Containerable>
-
findProperty
- Specified by:
findProperty
in interfacePrismContainer<C extends Containerable>
-
findReference
- Specified by:
findReference
in interfacePrismContainer<C extends Containerable>
-
findOrCreateItem
public <IV extends PrismValue,ID extends ItemDefinition<?>, I findOrCreateItemI extends Item<IV, ID>> (ItemPath containerPath, Class<I> type) throws SchemaException - Specified by:
findOrCreateItem
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
findOrCreateItem
public <IV extends PrismValue,ID extends ItemDefinition<?>, I findOrCreateItemI extends Item<IV, ID>> (ItemPath containerPath, Class<I> type, ID definition) throws SchemaException - Specified by:
findOrCreateItem
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
findOrCreateContainer
public <T extends Containerable> PrismContainer<T> findOrCreateContainer(ItemPath containerPath) throws SchemaException - Specified by:
findOrCreateContainer
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
findOrCreateProperty
- Specified by:
findOrCreateProperty
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
findOrCreateReference
- Specified by:
findOrCreateReference
in interfacePrismContainer<C extends Containerable>
- Throws:
SchemaException
-
remove
Description copied from interface:PrismContainer
Convenience method. Works only on single-valued containers.- Specified by:
remove
in interfacePrismContainer<C extends Containerable>
-
removeProperty
- Specified by:
removeProperty
in interfacePrismContainer<C extends Containerable>
-
removeContainer
- Specified by:
removeContainer
in interfacePrismContainer<C extends Containerable>
-
removeReference
- Specified by:
removeReference
in interfacePrismContainer<C extends Containerable>
-
removeItem
public <IV extends PrismValue,ID extends ItemDefinition<?>, void removeItemI extends Item<IV, ID>> (ItemPath path, Class<I> itemType) - Specified by:
removeItem
in interfacePrismContainer<C extends 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<C extends Containerable>,
PrismContainerDefinition<C extends Containerable>> - Specified by:
createDelta
in interfacePrismContainer<C extends Containerable>
-
createDelta
- Specified by:
createDelta
in interfaceItem<PrismContainerValue<C extends Containerable>,
PrismContainerDefinition<C extends Containerable>> - Specified by:
createDelta
in interfacePrismContainer<C extends Containerable>
-
diff
- Specified by:
diff
in interfacePrismContainer<C extends Containerable>
-
diff
- Specified by:
diff
in interfacePrismContainer<C extends Containerable>
-
diffModifications
public List<? extends ItemDelta> diffModifications(PrismContainer<C> other, ParameterizedEquivalenceStrategy strategy) - Specified by:
diffModifications
in interfacePrismContainer<C extends Containerable>
-
createImmutableClone
- Specified by:
createImmutableClone
in interfaceItem<PrismContainerValue<C extends Containerable>,
PrismContainerDefinition<C extends Containerable>> - Specified by:
createImmutableClone
in interfacePrismContainer<C extends Containerable>
-
deepCloneDefinition
public PrismContainerDefinition<C> deepCloneDefinition(@NotNull @NotNull DeepCloneOperation operation) - Specified by:
deepCloneDefinition
in interfacePrismContainer<C extends Containerable>
-
equivalent
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<C extends Containerable>
-
clone
Description copied from interface:Item
Literal clone.- Specified by:
clone
in interfaceItem<PrismContainerValue<C extends Containerable>,
PrismContainerDefinition<C extends Containerable>> - Specified by:
clone
in interfacePrismContainer<C extends Containerable>
- Specified by:
clone
in classDummyItem<PrismContainerValue<C extends Containerable>,
PrismContainerDefinition<C extends Containerable>, PrismContainer<C extends Containerable>>
-
cloneComplex
Description copied from interface:Item
Complex clone with different cloning strategies.- Specified by:
cloneComplex
in interfaceItem<PrismContainerValue<C extends Containerable>,
PrismContainerDefinition<C extends Containerable>> - Specified by:
cloneComplex
in interfacePrismContainer<C extends Containerable>
- See Also:
-
trimDefinitionTree
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<C extends Containerable>
-