Class ShadowReferenceAttributeValue
java.lang.Object
com.evolveum.midpoint.prism.AbstractFreezable
com.evolveum.midpoint.prism.impl.PrismValueImpl
com.evolveum.midpoint.prism.impl.PrismReferenceValueImpl
com.evolveum.midpoint.schema.processor.ShadowReferenceAttributeValue
- All Implemented Interfaces:
Freezable
,ItemDefinitionTransformer.TransformableValue
,MidpointOriginMetadata
,PathVisitable
,PrismReferenceValue
,PrismValue
,PrismVisitable
,Revivable
,SchemaLookup.Aware
,Visitable
,DebugDumpable
,ShortDumpable
,Serializable
public class ShadowReferenceAttributeValue
extends com.evolveum.midpoint.prism.impl.PrismReferenceValueImpl
Represents a value of a
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.
Any places where this is checked, will throw IllegalStateException
instead of SchemaException
.
We will simply not allow creating a non-compliant reference attribute value. At least we'll try to do this.
The exception are situations where the object exists between instantiation and providing the data.- See Also:
-
Field Summary
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 TypeMethodDescription@NotNull ObjectReferenceType
clone()
Literal clone.cloneComplex
(@NotNull CloneStrategy strategy) Complex clone with different cloning strategies.empty()
static @NotNull ShadowReferenceAttributeValue
fromReferencable
(@NotNull Referencable referencable) static @NotNull ShadowReferenceAttributeValue
fromRefValue
(@NotNull PrismReferenceValue refVal) Converts (potentially raw)PrismReferenceValue
to wrappedShadowReferenceAttributeValue
.static @NotNull ShadowReferenceAttributeValue
fromShadow
(@NotNull AbstractShadow shadow) Creates a new value from the full or ID-only shadow.static @NotNull ShadowReferenceAttributeValue
fromShadowOid
(@NotNull String oid) @Nullable ResourceObjectDefinition
@NotNull ShadowAttributesContainer
@NotNull ShadowReferenceAttributeDefinition
@NotNull ResourceObjectIdentification<?>
@NotNull String
@NotNull AbstractShadow
@NotNull ShadowType
Target object or its reference.@Nullable AbstractShadow
@NotNull AbstractShadow
@NotNull PrismPropertyValue<?>
getSingleIdentifierValueRequired
(@NotNull QName attrName, Object errorCtx) @NotNull ResourceObjectDefinition
boolean
static @NotNull EqualsChecker<ShadowReferenceAttributeValue>
Returns an equals checker that compares two reference attribute values, i.e., two shadows that they point to.void
setShadow
(@NotNull AbstractShadow shadow) void
Show the content of the object intended for diagnostics.toString()
Methods inherited from class com.evolveum.midpoint.prism.impl.PrismReferenceValueImpl
accept, applyDefinition, applyDefinition, asReferencable, asReferencables, asReferenceValues, checkConsistenceInternal, containsOid, copyValues, createImmutableClone, debugDump, debugDump, debugDump, equals, equals, find, findPartial, findReferencedItem, getAllValues, getDefinition, getDescription, getFilter, getObject, getOid, getRealClass, getRealValue, getReferentialIntegrity, getRelation, getResolutionTime, getSchemaContext, getTargetName, getTargetType, getTargetTypeCompileTimeClass, hashCode, isEmpty, isRaw, recompute, relation, revive, setDescription, setFilter, setObject, setOid, setReferentialIntegrity, setRelation, setResolutionTime, setTargetName, setTargetName, setTargetType, setTargetType, toCanonical, transformDefinition
Methods inherited from class com.evolveum.midpoint.prism.impl.PrismValueImpl
accept, appendOriginDump, clearParent, copyValues, diff, diffMatchingRepresentation, diffMatchingRepresentation, equals, equals, getAllItems, getOriginObject, getOriginType, getParent, getParentContainerValue, getPath, getPathComponent, getRootValue, getTypeName, getUserData, getUserData, getValueMetadata, getValueMetadataIfExists, hashCode, hashCode, hasValueMetadata, isTransient, normalize, performFreeze, recompute, representsSameValue, schemaLookup, 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
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.PrismReferenceValue
acceptVisitor, determineTargetTypeName, getEffectiveResolutionTime, getObjectable
Methods inherited from interface com.evolveum.midpoint.prism.PrismValue
accept, applyDefinition, applyDefinitionLegacy, applyDefinitionLegacy, clearParent, cloneIfImmutable, deleteValueMetadata, diff, equals, getAllItems, getNearestValueOfType, getParent, getParentContainerValue, getPath, getRealValueIfExists, getRealValueOrRawType, getRootObjectable, getRootValue, getTypeName, getUserData, getUserData, getValueMetadata, getValueMetadataAsContainer, getValueMetadataIfExists, hashCode, hasRealClass, hasValueMetadata, isObjectable, isOfType, isTransient, normalize, recompute, representsSameValue, schemaLookup, setParent, setTransient, setUserData, setValueMetadata, setValueMetadata, setValueMetadata
Methods inherited from interface com.evolveum.midpoint.util.ShortDumpable
shortDump, shortDumpLazily
-
Method Details
-
fromRefValue
@NotNull public static @NotNull ShadowReferenceAttributeValue fromRefValue(@NotNull @NotNull PrismReferenceValue refVal) throws SchemaException Converts (potentially raw)PrismReferenceValue
to wrappedShadowReferenceAttributeValue
. We should not use the original value any more, e.g. because of values being copied.- Throws:
SchemaException
-
fromReferencable
@NotNull public static @NotNull ShadowReferenceAttributeValue fromReferencable(@NotNull @NotNull Referencable referencable) throws SchemaException - Throws:
SchemaException
-
fromShadow
@NotNull public static @NotNull ShadowReferenceAttributeValue fromShadow(@NotNull @NotNull AbstractShadow shadow) throws SchemaException Creates a new value from the full or ID-only shadow. No cloning here.- Throws:
SchemaException
-
fromShadowOid
@NotNull public static @NotNull ShadowReferenceAttributeValue fromShadowOid(@NotNull @NotNull String oid) throws SchemaException - Throws:
SchemaException
-
semanticEqualsChecker
@NotNull public static @NotNull EqualsChecker<ShadowReferenceAttributeValue> semanticEqualsChecker()Returns an equals checker that compares two reference attribute values, i.e., two shadows that they point to. - We use OIDs for comparison, if available. - If not, we compare shadows by their content - in a relaxed way, seeShadowUtil.equalsByContent(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType, com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)
. -
empty
-
clone
Description copied from interface:PrismValue
Literal clone.- Specified by:
clone
in interfacePrismReferenceValue
- Specified by:
clone
in interfacePrismValue
- Overrides:
clone
in classcom.evolveum.midpoint.prism.impl.PrismReferenceValueImpl
-
cloneComplex
Description copied from interface:PrismValue
Complex clone with different cloning strategies.- Specified by:
cloneComplex
in interfacePrismReferenceValue
- Specified by:
cloneComplex
in interfacePrismValue
- Overrides:
cloneComplex
in classcom.evolveum.midpoint.prism.impl.PrismReferenceValueImpl
- See Also:
-
getAttributesContainerRequired
-
getShadowBean
Target object or its reference. TODO better name. -
getShadow
-
getTargetObjectClassName
-
getDefinitionRequired
-
getIdentification
-
asObjectReferenceType
-
getShadowIfPresent
-
getShadowRequired
-
getAssociatedObjectDefinitionIfPresent
-
getTargetObjectDefinition
-
getAttributesContainerIfPresent
-
setShadow
-
matches
-
getSingleIdentifierValueRequired
@NotNull public @NotNull PrismPropertyValue<?> getSingleIdentifierValueRequired(@NotNull @NotNull QName attrName, Object errorCtx) throws SchemaException - Throws:
SchemaException
-
getOidRequired
-
toString
- Overrides:
toString
in classcom.evolveum.midpoint.prism.impl.PrismReferenceValueImpl
-
shortDump
Description copied from interface:ShortDumpable
Show the content of the object intended for diagnostics. This method is supposed to append a compact, human-readable output in a single line. Unlike toString() method, there is no requirement to identify the actual class or type of the object. It is assumed that the class/type will be obvious from the context in which the output is used.- Specified by:
shortDump
in interfaceShortDumpable
- Overrides:
shortDump
in classcom.evolveum.midpoint.prism.impl.PrismReferenceValueImpl
- Parameters:
sb
- StringBuilder to which to a compact one-line content of the object intended for diagnostics by system administrator should be appended.
-
toHumanReadableString
- Specified by:
toHumanReadableString
in interfacePrismValue
- Overrides:
toHumanReadableString
in classcom.evolveum.midpoint.prism.impl.PrismReferenceValueImpl
-