Package com.evolveum.midpoint.prism.impl
Class PrismReferenceImpl
- java.lang.Object
-
- com.evolveum.midpoint.prism.impl.ItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
- com.evolveum.midpoint.prism.impl.PrismReferenceImpl
-
- All Implemented Interfaces:
Item<PrismReferenceValue,PrismReferenceDefinition>
,Itemable
,ParentVisitable
,PathVisitable
,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
defaultEquivalenceStrategy, 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 void
checkDefinition(PrismReferenceDefinition def)
PrismReferenceImpl
clone()
Literal clone.PrismReferenceImpl
cloneComplex(CloneStrategy strategy)
Complex clone with different cloning strategies.protected void
copyValues(CloneStrategy strategy, PrismReferenceImpl clone)
ReferenceDelta
createDelta()
Creates specific subclass of ItemDelta appropriate for type of item that this definition represents (e.g.ReferenceDelta
createDelta(ItemPath path)
String
debugDump(int indent)
Object
find(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)
PrismReferenceValue
findValueByOid(String oid)
protected String
getDebugDumpClassName()
Return a human readable name of this class suitable for logs.String
getOid()
Referencable
getRealValue()
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.Collection<Referencable>
getRealValues()
Returns (potentially empty) collection of "real values".PolyString
getTargetName()
PrismReferenceValue
getValue()
Returns the value, if there is only one.boolean
merge(PrismReferenceValue value)
String
toString()
-
Methods inherited from class com.evolveum.midpoint.prism.impl.ItemImpl
accept, accept, acceptParentVisitor, add, add, add, add, addAll, addAll, appendDebugDumpSuffix, applyDefinition, applyDefinition, assertDefinitions, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistenceInternal, checkImmutability, checkMutability, clear, contains, contains, contains, containsEquivalentValue, containsEquivalentValue, copyValues, diff, equals, equals, equals, filterValues, findValue, fixupDelta, getAllValues, getAnyValue, getClonedValues, getDefinition, getDisplayName, getElementName, getEqualsHashCodeStrategy, getHelp, getHighestId, getParent, getPath, getPathComponent, getPrismContext, getPrismContextLocal, getUserData, getUserData, getValues, hasCompleteDefinition, hashCode, hashCode, hashCode, hasNoValues, hasRaw, isEmpty, isImmutable, isIncomplete, isOperational, isRaw, isSingleValue, merge, modifyUnfrozen, modifyUnfrozen, normalize, propagateDeepCloneDefinition, recomputeAllValues, remove, remove, remove, removeAll, replace, replaceAll, revive, setDefinition, setElementName, setImmutable, setIncomplete, setParent, setPrismContext, setUserData, size, valuesEqual
-
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.Item
acceptParentVisitor, add, add, add, addAll, addAll, applyDefinition, applyDefinition, assertDefinitions, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistenceInternal, checkImmutability, clear, contains, contains, contains, containsEquivalentValue, containsEquivalentValue, diff, diff, equals, equals, equals, filterValues, findValue, getAllValues, getAnyValue, getClonedValues, getDefinition, getDisplayName, getElementName, getHelp, getHighestId, getParent, getPath, getPrismContext, getPrismContextLocal, getRealValuesOrRawTypes, getUserData, getUserData, getValues, hasCompleteDefinition, hashCode, hashCode, hashCode, hasNoValues, hasRaw, isEmpty, isImmutable, isIncomplete, isOperational, isRaw, isSingleValue, merge, modifyUnfrozen, modifyUnfrozen, normalize, recomputeAllValues, remove, remove, removeAll, replace, replaceAll, revive, setDefinition, setElementName, setImmutable, setIncomplete, setParent, setPrismContext, setUserData, size, valuesEqual
-
Methods inherited from interface com.evolveum.midpoint.prism.PathVisitable
accept
-
-
-
-
Constructor Detail
-
PrismReferenceImpl
public PrismReferenceImpl(QName name)
-
-
Method Detail
-
getValue
@NotNull public PrismReferenceValue getValue()
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<PrismReferenceValue,PrismReferenceDefinition>
- Overrides:
getValue
in classItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
getRealValue
public Referencable 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<PrismReferenceValue,PrismReferenceDefinition>
- Specified by:
getRealValue
in interfacePrismReference
- Overrides:
getRealValue
in classItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
getRealValues
@NotNull public Collection<Referencable> getRealValues()
Description copied from interface:Item
Returns (potentially empty) collection of "real values".- Specified by:
getRealValues
in interfaceItem<PrismReferenceValue,PrismReferenceDefinition>
- Specified by:
getRealValues
in interfacePrismReference
-
merge
public boolean merge(PrismReferenceValue value)
- Specified by:
merge
in interfacePrismReference
-
getOid
public String getOid()
- Specified by:
getOid
in interfacePrismReference
-
getTargetName
public PolyString getTargetName()
- Specified by:
getTargetName
in interfacePrismReference
-
findValueByOid
public PrismReferenceValue findValueByOid(String oid)
- Specified by:
findValueByOid
in interfacePrismReference
-
find
public Object find(ItemPath path)
Description copied from interface:Item
Returns object (Item or PrismValue) pointed to by the given path.- Specified by:
find
in interfaceItem<PrismReferenceValue,PrismReferenceDefinition>
- Specified by:
find
in interfacePrismReference
-
findPartial
public <IV extends PrismValue,ID extends ItemDefinition> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path)
- Specified by:
findPartial
in interfaceItem<PrismReferenceValue,PrismReferenceDefinition>
- Specified by:
findPartial
in interfacePrismReference
-
createDelta
public ReferenceDelta 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<PrismReferenceValue,PrismReferenceDefinition>
- Specified by:
createDelta
in interfacePrismReference
-
createDelta
public ReferenceDelta createDelta(ItemPath path)
- Specified by:
createDelta
in interfaceItem<PrismReferenceValue,PrismReferenceDefinition>
- Specified by:
createDelta
in interfacePrismReference
-
checkDefinition
protected void checkDefinition(PrismReferenceDefinition def)
- Specified by:
checkDefinition
in classItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
clone
public PrismReferenceImpl clone()
Description copied from interface:Item
Literal clone.- Specified by:
clone
in interfaceItem<PrismReferenceValue,PrismReferenceDefinition>
- Specified by:
clone
in interfacePrismReference
- Specified by:
clone
in classItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
cloneComplex
public PrismReferenceImpl cloneComplex(CloneStrategy strategy)
Description copied from interface:Item
Complex clone with different cloning strategies.- Specified by:
cloneComplex
in interfaceItem<PrismReferenceValue,PrismReferenceDefinition>
- Specified by:
cloneComplex
in interfacePrismReference
- See Also:
CloneStrategy
-
copyValues
protected void copyValues(CloneStrategy strategy, PrismReferenceImpl clone)
-
toString
public String toString()
- Specified by:
toString
in interfacePrismReference
- Overrides:
toString
in classItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
- Specified by:
debugDump
in interfacePrismReference
- Overrides:
debugDump
in classItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
getDebugDumpClassName
protected String getDebugDumpClassName()
Return a human readable name of this class suitable for logs.- Overrides:
getDebugDumpClassName
in classItemImpl<PrismReferenceValue,PrismReferenceDefinition>
-
-