Class ShadowAssociationValue
java.lang.Object
com.evolveum.midpoint.prism.AbstractFreezable
com.evolveum.midpoint.prism.impl.PrismValueImpl
com.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
com.evolveum.midpoint.schema.processor.ShadowAssociationValue
- All Implemented Interfaces:
Freezable
,ItemDefinitionTransformer.TransformableValue
,MidpointOriginMetadata
,ParentVisitable
,PathVisitable
,PrismContainerValue<ShadowAssociationValueType>
,PrismValue
,Revivable
,Visitable
,DebugDumpable
,Serializable
@Experimental
public class ShadowAssociationValue
extends com.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
Represents a specific shadow association value - i.e. something that is put into
ShadowReferenceAttribute
.
For example, a single group membership for a given account: `joe` is a member of `admins`.
NOTE: As an experiment, we try to keep instances as consistent as possible. E.g., we require correct `shadowRef` etc.
Any places where this is checked, will throw IllegalStateException
instead of SchemaException
.
We will simply not allow creating a non-compliant association object. At least we'll try to do this.
The exception are situations where the object exists between instantiation and providing the data.
*Instantiation*
In particular, we must provide reasonable CTD when instantiating this object.
Otherwise, PrismContainerValue.asContainerable()
will fail.
TODO check if it's possible to implement this approach regarding createNewValue in ShadowAssociation- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.evolveum.midpoint.prism.PrismContainerValue
PrismContainerValue.RemovedItemDefinitionException
-
Field Summary
Fields inherited from class com.evolveum.midpoint.prism.impl.PrismContainerValueImpl
complexTypeDefinition, DIFFERENT_ITEMS_EXCEPTION, items, unqualifiedItemNames
Fields inherited from class com.evolveum.midpoint.prism.impl.PrismValueImpl
defaultEquivalenceStrategy
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
appendExtraHeaderDump
(StringBuilder sb, int indent, boolean wasIndent) cloneComplex
(CloneStrategy strategy) Complex clone with different cloning strategies.static ShadowAssociationValue
empty()
@NotNull ResourceObjectDefinition
@Nullable ResourceObjectDefinition
@NotNull ShadowAssociationsContainer
@NotNull ShadowAttributesContainer
@NotNull ShadowReferenceAttributeDefinition
@NotNull ResourceObjectIdentification<?>
@NotNull AbstractShadow
@NotNull ShadowType
Target object or its reference.@Nullable AbstractShadow
@NotNull ObjectReferenceType
@NotNull AbstractShadow
boolean
boolean
static @NotNull ShadowAssociationValue
of
(@NotNull AbstractShadow shadow, boolean identifiersOnly) Creates a new value from the full or ID-only shadow.static @NotNull ShadowAssociationValue
of
(@NotNull ShadowAssociationValueType bean, @NotNull ShadowReferenceAttributeDefinition definition) Converts association value bean to wrappedShadowAssociationValue
basically by cloning its content and selected properties (e.g., parent and ID).rawWithReferenceTo
(@NotNull String targetOid) Intentionally not returningShadowAssociationValue
; because it is not valid due to missing (resolved) shadow.void
setIdentifiersOnly
(boolean value) void
setShadow
(@NotNull AbstractShadow shadow) Methods inherited from class com.evolveum.midpoint.prism.impl.PrismContainerValueImpl
accept, accept, acceptParentVisitor, add, add, addAll, addAllReplaceExisting, addRawElement, addReplaceExisting, applyDefinition, applyDefinition, applyDefinition, asContainerable, asContainerable, asContainerable, asContainerables, asContainerables, asPrismContainerValues, assertDefinitions, assertDefinitions, asSingleValuedContainer, canRepresent, checkConsistenceInternal, clear, clone, contains, contains, containsItem, containsRealValue, copyValues, createDetachedSubItem, createImmutableClone, createProperty, createProperty, debugDump, debugDumpIdentifiers, deleteRawElement, detailedDebugDumpStart, diffMatchingRepresentation, equals, equivalent, find, findContainer, findItem, findItem, findOrCreateContainer, findOrCreateItem, findOrCreateItem, findOrCreateItem, findOrCreateProperty, findOrCreateProperty, findOrCreateReference, findPartial, findProperty, findProperty, findReference, getAllItems, getAllValues, getCompileTimeClass, getComplexTypeDefinition, getContainer, getDefinition, getId, getIdentifier, getItemNames, getItems, getItems, getParent, getPath, getPathComponent, getProperties, getPropertyRealValue, getRealClass, getRealValue, getRootValue, getTypeName, getValue, hasCompleteDefinition, hashCode, hasNoItems, isEmpty, isIdOnly, isRaw, keepPaths, merge, mergeContent, normalize, performFreeze, recompute, remove, removeAll, removeContainer, removeItems, removeOperationalItems, removePaths, removeProperty, removeRawElement, removeReference, replace, representsSameValue, revive, setId, setOriginTypeRecursive, setPropertyRealValue, simpleAdd, size, subtract, toHumanReadableString, toPcvList, toString, transformDefinition
Methods inherited from class com.evolveum.midpoint.prism.impl.PrismValueImpl
appendOriginDump, clearParent, copyValues, diff, diffMatchingRepresentation, equals, equals, getOriginObject, getOriginType, getParentContainerValue, getUserData, getUserData, getValueMetadata, hashCode, hashCode, hasValueMetadata, isTransient, recompute, setOriginObject, setOriginType, setParent, 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
checkNothingExceptFor, findItem, getItemRealValue
Methods inherited from interface com.evolveum.midpoint.prism.PrismValue
applyDefinitionLegacy, applyDefinitionLegacy, clearParent, cloneIfImmutable, diff, equals, getNearestValueOfType, getParentContainerValue, getRealValueIfExists, getRealValueOrRawType, getRootObjectable, getUserData, getUserData, getValueMetadata, getValueMetadataAsContainer, hashCode, hasRealClass, hasValueMetadata, isObjectable, isOfType, isTransient, recompute, setParent, setTransient, setUserData, setValueMetadata, setValueMetadata, setValueMetadata, valueMetadata
-
Method Details
-
of
@NotNull public static @NotNull ShadowAssociationValue of(@NotNull @NotNull ShadowAssociationValueType bean, @NotNull @NotNull ShadowReferenceAttributeDefinition definition) Converts association value bean to wrappedShadowAssociationValue
basically by cloning its content and selected properties (e.g., parent and ID). We should not use the original value any more, e.g. because of the copied "parent" value. -
of
@NotNull public static @NotNull ShadowAssociationValue of(@NotNull @NotNull AbstractShadow shadow, boolean identifiersOnly) Creates a new value from the full or ID-only shadow. No cloning here. -
setIdentifiersOnly
public void setIdentifiersOnly(boolean value) -
hasIdentifiersOnly
public boolean hasIdentifiersOnly() -
hasFullObject
public boolean hasFullObject() -
empty
-
rawWithReferenceTo
@TestOnly public static PrismContainerValue<ShadowAssociationValueType> rawWithReferenceTo(@NotNull @NotNull String targetOid) Intentionally not returningShadowAssociationValue
; because it is not valid due to missing (resolved) shadow. -
cloneComplex
Description copied from interface:PrismValue
Complex clone with different cloning strategies.- Specified by:
cloneComplex
in interfacePrismContainerValue<ShadowAssociationValueType>
- Specified by:
cloneComplex
in interfacePrismValue
- Overrides:
cloneComplex
in classcom.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
- See Also:
-
getAttributesContainerRequired
-
getAssociationsContainer
-
getShadowBean
Target object or its reference. TODO better name. -
getShadow
-
getTargetObjectClassName
-
getDefinitionRequired
-
getIdentification
-
getShadowRef
-
getShadowIfPresent
-
getShadowRequired
-
getAssociatedObjectDefinitionIfPresent
-
getAssociatedObjectDefinition
-
getAttributesContainerIfPresent
-
setShadow
-
appendExtraHeaderDump
- Overrides:
appendExtraHeaderDump
in classcom.evolveum.midpoint.prism.impl.PrismContainerValueImpl<ShadowAssociationValueType>
-