Package com.evolveum.midpoint.prism.impl
Class PrismReferenceImpl
- java.lang.Object
-
- com.evolveum.midpoint.prism.AbstractFreezable
-
- com.evolveum.midpoint.prism.impl.ItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
- com.evolveum.midpoint.prism.impl.PrismReferenceImpl
-
- All Implemented Interfaces:
Freezable,Item<PrismReferenceValue,PrismReferenceDefinition>,Itemable,ParentVisitable,PathVisitable,PrismContextSensitive,PrismReference,Revivable,Visitable,DebugDumpable,Serializable
public class PrismReferenceImpl extends ItemImpl<PrismReferenceValue,PrismReferenceDefinition> implements PrismReference
Object Reference is a property that describes reference to an object. It is used to represent association between objects. For example reference from User object to Account objects that belong to the user. The reference is a simple uni-directional link using an OID as an identifier. This type should be used for all object references so the implementations can detect them and automatically resolve them.- Author:
- semancik
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.evolveum.midpoint.prism.impl.ItemImpl
definition, elementName, immutable, incomplete, parent, prismContext, values
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description PrismReferenceImpl(QName name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckDefinition(PrismReferenceDefinition def)PrismReferenceImplclone()Literal clone.PrismReferenceImplcloneComplex(CloneStrategy strategy)Complex clone with different cloning strategies.protected voidcopyValues(CloneStrategy strategy, PrismReferenceImpl clone)ReferenceDeltacreateDelta()Creates specific subclass of ItemDelta appropriate for type of item that this definition represents (e.g.ReferenceDeltacreateDelta(ItemPath path)PrismReferencecreateImmutableClone()StringdebugDump(int indent)Objectfind(ItemPath path)Returns object (Item or PrismValue) pointed to by the given path.<IV extends PrismValue,ID extends ItemDefinition>
PartiallyResolvedItem<IV,ID>findPartial(ItemPath path)PrismReferenceValuefindValueByOid(String oid)protected StringgetDebugDumpClassName()Return a human readable name of this class suitable for logs.StringgetOid()ReferencablegetRealValue()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.@NotNull Collection<Referencable>getRealValues()Returns (potentially empty) collection of "real values".PolyStringgetTargetName()@NotNull PrismReferenceValuegetValue()Returns the value, if there is only one.booleanmerge(PrismReferenceValue value)StringtoString()-
Methods inherited from class com.evolveum.midpoint.prism.impl.ItemImpl
accept, accept, acceptParentVisitor, add, addAll, addForced, addIgnoringEquivalents, addInternal, addInternalExecution, addRespectingMetadataAndCloning, appendDebugDumpSuffix, applyDefinition, applyDefinition, assertDefinitions, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistenceInternal, clear, copyValues, diff, equals, equals, equals, fixupDelta, getAllValues, getDefinition, getElementName, getHighestId, getParent, getPath, getPathComponent, getPrismContext, getPrismContextLocal, getRealValue, getRealValuesArray, getUserData, getUserData, getValues, hashCode, hashCode, hashCode, isIncomplete, merge, normalize, performFreeze, propagateDeepCloneDefinition, recomputeAllValues, remove, remove, removeAll, removeRespectingMetadata, replace, replaceAll, revive, setDefinition, setElementName, setIncomplete, setParent, setPrismContext, setUserData
-
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.Item
acceptParentVisitor, add, add, addAll, addAll, addIgnoringEquivalents, addRespectingMetadataAndCloning, applyDefinition, applyDefinition, assertDefinitions, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistenceInternal, clear, contains, contains, copy, diff, diff, equals, equals, equals, filterValues, filterYields, findValue, findValue, getAllValues, getAnyValue, getAnyValue, getClonedValues, getDefinition, getDisplayName, getElementName, getHelp, getHighestId, getParent, getPath, getPrismContextLocal, getRealValue, getRealValuesArray, getRealValuesOrRawTypes, getUserData, getUserData, getValues, hasAnyValue, hasCompleteDefinition, hashCode, hashCode, hashCode, hasNoValues, hasRaw, isEmpty, isIncomplete, isOperational, isRaw, isSingleValue, isSingleValueByDefinition, merge, normalize, recomputeAllValues, remove, remove, removeAll, removeIf, removeRespectingMetadata, replace, replaceAll, setDefinition, setElementName, setIncomplete, setParent, setPrismContext, setUserData, size, valuesStream
-
Methods inherited from interface com.evolveum.midpoint.prism.PathVisitable
accept
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContext
-
-
-
-
Constructor Detail
-
PrismReferenceImpl
public PrismReferenceImpl(QName name)
-
-
Method Detail
-
getValue
@NotNull public @NotNull PrismReferenceValue getValue()
Description copied from interface:ItemReturns 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:
getValuein interfaceItem<PrismReferenceValue,PrismReferenceDefinition>- Overrides:
getValuein classItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
getRealValue
public Referencable getRealValue()
Description copied from interface:ItemReturns 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:
getRealValuein interfaceItem<PrismReferenceValue,PrismReferenceDefinition>- Specified by:
getRealValuein interfacePrismReference- Overrides:
getRealValuein classItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
getRealValues
@NotNull public @NotNull Collection<Referencable> getRealValues()
Description copied from interface:ItemReturns (potentially empty) collection of "real values".- Specified by:
getRealValuesin interfaceItem<PrismReferenceValue,PrismReferenceDefinition>- Specified by:
getRealValuesin interfacePrismReference
-
merge
public boolean merge(PrismReferenceValue value)
- Specified by:
mergein interfacePrismReference
-
getOid
public String getOid()
- Specified by:
getOidin interfacePrismReference
-
getTargetName
public PolyString getTargetName()
- Specified by:
getTargetNamein interfacePrismReference
-
findValueByOid
public PrismReferenceValue findValueByOid(String oid)
- Specified by:
findValueByOidin interfacePrismReference
-
find
public Object find(ItemPath path)
Description copied from interface:ItemReturns object (Item or PrismValue) pointed to by the given path.- Specified by:
findin interfaceItem<PrismReferenceValue,PrismReferenceDefinition>
-
findPartial
public <IV extends PrismValue,ID extends ItemDefinition> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path)
- Specified by:
findPartialin interfaceItem<PrismReferenceValue,PrismReferenceDefinition>- Specified by:
findPartialin interfacePrismReference
-
createDelta
public ReferenceDelta createDelta()
Description copied from interface:ItemCreates specific subclass of ItemDelta appropriate for type of item that this definition represents (e.g. PropertyDelta, ContainerDelta, ...)- Specified by:
createDeltain interfaceItem<PrismReferenceValue,PrismReferenceDefinition>- Specified by:
createDeltain interfacePrismReference
-
createDelta
public ReferenceDelta createDelta(ItemPath path)
- Specified by:
createDeltain interfaceItem<PrismReferenceValue,PrismReferenceDefinition>- Specified by:
createDeltain interfacePrismReference
-
checkDefinition
protected void checkDefinition(PrismReferenceDefinition def)
- Specified by:
checkDefinitionin classItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
clone
public PrismReferenceImpl clone()
Description copied from interface:ItemLiteral clone.- Specified by:
clonein interfaceItem<PrismReferenceValue,PrismReferenceDefinition>- Specified by:
clonein interfacePrismReference- Specified by:
clonein classItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
createImmutableClone
public PrismReference createImmutableClone()
- Specified by:
createImmutableClonein interfaceItem<PrismReferenceValue,PrismReferenceDefinition>- Specified by:
createImmutableClonein interfacePrismReference- Overrides:
createImmutableClonein classItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
cloneComplex
public PrismReferenceImpl cloneComplex(CloneStrategy strategy)
Description copied from interface:ItemComplex clone with different cloning strategies.- Specified by:
cloneComplexin interfaceItem<PrismReferenceValue,PrismReferenceDefinition>- Specified by:
cloneComplexin interfacePrismReference- See Also:
CloneStrategy
-
copyValues
protected void copyValues(CloneStrategy strategy, PrismReferenceImpl clone)
-
toString
public String toString()
- Specified by:
toStringin interfacePrismReference- Overrides:
toStringin classItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDumpin interfaceDebugDumpable- Specified by:
debugDumpin interfacePrismReference- Overrides:
debugDumpin classItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
getDebugDumpClassName
protected String getDebugDumpClassName()
Return a human readable name of this class suitable for logs.- Overrides:
getDebugDumpClassNamein classItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
-