Package com.evolveum.midpoint.prism.impl
Class PrismPropertyImpl<T>
- java.lang.Object
-
- com.evolveum.midpoint.prism.AbstractFreezable
-
- com.evolveum.midpoint.prism.impl.ItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
- com.evolveum.midpoint.prism.impl.PrismPropertyImpl<T>
-
- All Implemented Interfaces:
Freezable
,Item<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
,Itemable
,ParentVisitable
,PathVisitable
,PrismContextSensitive
,PrismProperty<T>
,Revivable
,Visitable
,DebugDumpable
,Serializable
- Direct Known Subclasses:
ResourceAttributeImpl
public class PrismPropertyImpl<T> extends ItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>> implements PrismProperty<T>
Property is a specific characteristic of an object. It may be considered object "attribute" or "field". For example User has fullName property that contains string value of user's full name.Properties may be single-valued or multi-valued
Properties may contain primitive types or complex types (defined by XSD schema)
Property values are unordered, implementation may change the order of values
Duplicate values of properties should be silently removed by implementations, but clients must be able tolerate presence of duplicate values.
Operations that modify the objects work with the granularity of properties. They add/remove/replace the values of properties, but do not "see" inside the property.
Property is mutable.
- Author:
- Radovan 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 Modifier Constructor Description PrismPropertyImpl(QName name)
PrismPropertyImpl(QName name, PrismContext prismContext)
protected
PrismPropertyImpl(QName name, PrismPropertyDefinition<T> definition, PrismContext prismContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRealValue(T valueToAdd)
void
addRealValueSkipUniquenessCheck(T valueToAdd)
void
addValue(PrismPropertyValue<T> pValueToAdd)
void
addValue(PrismPropertyValue<T> pValueToAdd, boolean checkUniqueness)
void
addValues(Collection<PrismPropertyValue<T>> pValuesToAdd)
protected void
checkDefinition(PrismPropertyDefinition<T> def)
PrismProperty<T>
clone()
Literal clone.PrismProperty<T>
cloneComplex(CloneStrategy strategy)
Complex clone with different cloning strategies.protected void
copyValues(CloneStrategy strategy, PrismPropertyImpl<T> clone)
PropertyDelta<T>
createDelta()
Creates specific subclass of ItemDelta appropriate for type of item that this definition represents (e.g.PropertyDelta<T>
createDelta(ItemPath path)
PrismProperty<T>
createImmutableClone()
String
debugDump(int indent)
boolean
deleteValue(PrismPropertyValue<T> pValueToDelete)
boolean
deleteValues(Collection<PrismPropertyValue<T>> pValuesToDelete)
PropertyDelta<T>
diff(PrismProperty<T> other)
PropertyDelta<T>
diff(PrismProperty<T> other, ParameterizedEquivalenceStrategy strategy)
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)
protected ItemDelta
fixupDelta(ItemDelta delta, Item otherItem)
T
getAnyRealValue()
protected String
getDebugDumpClassName()
Return a human readable name of this class suitable for logs.PrismPropertyDefinition<T>
getDefinition()
Returns applicable property definition.T
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.@NotNull Collection<T>
getRealValues()
Returns (potentially empty) collection of "real values".<X> Collection<X>
getRealValues(Class<X> type)
Type override, also for compatibility.<X> PrismPropertyValue<X>
getValue(Class<X> type)
Type override, also for compatibility.Class<T>
getValueClass()
<X> List<PrismPropertyValue<X>>
getValues(Class<X> type)
Type override, also for compatibility.boolean
hasRealValue(PrismPropertyValue<T> value)
void
replaceValues(Collection<PrismPropertyValue<T>> valuesToReplace)
void
setDefinition(PrismPropertyDefinition<T> definition)
Sets applicable property definition.void
setRealValue(T realValue)
void
setRealValues(T... realValues)
void
setValue(PrismPropertyValue<T> value)
Means as a short-hand for setting just a value for single-valued attributes.String
toHumanReadableString()
String
toString()
-
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, getAllValues, getElementName, getHighestId, getParent, getPath, getPathComponent, getPrismContext, getPrismContextLocal, getRealValue, getRealValuesArray, getUserData, getUserData, getValue, getValues, hashCode, hashCode, hashCode, isIncomplete, merge, normalize, performFreeze, propagateDeepCloneDefinition, recomputeAllValues, remove, remove, removeAll, removeRespectingMetadata, replace, replaceAll, revive, 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, getDisplayName, getElementName, getHelp, getHighestId, getParent, getPath, getPrismContextLocal, getRealValue, getRealValuesArray, getRealValuesOrRawTypes, getUserData, getUserData, getValue, getValues, 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.PathVisitable
accept
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContext
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismProperty
addRealValues
-
-
-
-
Constructor Detail
-
PrismPropertyImpl
public PrismPropertyImpl(QName name)
-
PrismPropertyImpl
public PrismPropertyImpl(QName name, PrismContext prismContext)
-
PrismPropertyImpl
protected PrismPropertyImpl(QName name, PrismPropertyDefinition<T> definition, PrismContext prismContext)
-
-
Method Detail
-
getDefinition
public PrismPropertyDefinition<T> getDefinition()
Returns applicable property definition.May return null if no definition is applicable or the definition is not know.
- Specified by:
getDefinition
in interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
- Specified by:
getDefinition
in interfaceItemable
- Overrides:
getDefinition
in classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
- Returns:
- applicable property definition
-
setDefinition
public void setDefinition(PrismPropertyDefinition<T> definition)
Sets applicable property definition. TODO remove (method in Item is sufficient)- Specified by:
setDefinition
in interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
- Overrides:
setDefinition
in classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
- Parameters:
definition
- the definition to set
-
getValues
public <X> List<PrismPropertyValue<X>> getValues(Class<X> type)
Type override, also for compatibility.- Specified by:
getValues
in interfacePrismProperty<T>
-
getRealValues
@NotNull public @NotNull Collection<T> getRealValues()
Description copied from interface:Item
Returns (potentially empty) collection of "real values".- Specified by:
getRealValues
in interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
- Specified by:
getRealValues
in interfacePrismProperty<T>
-
getRealValues
public <X> Collection<X> getRealValues(Class<X> type)
Type override, also for compatibility.- Specified by:
getRealValues
in interfacePrismProperty<T>
-
getAnyRealValue
public T getAnyRealValue()
- Specified by:
getAnyRealValue
in interfacePrismProperty<T>
-
getRealValue
public T 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<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
- Specified by:
getRealValue
in interfacePrismProperty<T>
- Overrides:
getRealValue
in classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
getValue
public <X> PrismPropertyValue<X> getValue(Class<X> type)
Type override, also for compatibility.- Specified by:
getValue
in interfacePrismProperty<T>
-
setValue
public void setValue(PrismPropertyValue<T> value)
Means as a short-hand for setting just a value for single-valued attributes. Will remove all existing values.- Specified by:
setValue
in interfacePrismProperty<T>
-
setRealValue
public void setRealValue(T realValue)
- Specified by:
setRealValue
in interfacePrismProperty<T>
-
setRealValues
public void setRealValues(T... realValues)
- Specified by:
setRealValues
in interfacePrismProperty<T>
-
addValues
public void addValues(Collection<PrismPropertyValue<T>> pValuesToAdd)
- Specified by:
addValues
in interfacePrismProperty<T>
-
addValue
public void addValue(PrismPropertyValue<T> pValueToAdd)
- Specified by:
addValue
in interfacePrismProperty<T>
-
addValue
public void addValue(PrismPropertyValue<T> pValueToAdd, boolean checkUniqueness)
-
addRealValue
public void addRealValue(T valueToAdd)
- Specified by:
addRealValue
in interfacePrismProperty<T>
-
addRealValueSkipUniquenessCheck
public void addRealValueSkipUniquenessCheck(T valueToAdd)
- Specified by:
addRealValueSkipUniquenessCheck
in interfacePrismProperty<T>
-
deleteValues
public boolean deleteValues(Collection<PrismPropertyValue<T>> pValuesToDelete)
- Specified by:
deleteValues
in interfacePrismProperty<T>
-
deleteValue
public boolean deleteValue(PrismPropertyValue<T> pValueToDelete)
- Specified by:
deleteValue
in interfacePrismProperty<T>
-
replaceValues
public void replaceValues(Collection<PrismPropertyValue<T>> valuesToReplace)
- Specified by:
replaceValues
in interfacePrismProperty<T>
-
hasRealValue
public boolean hasRealValue(PrismPropertyValue<T> value)
- Specified by:
hasRealValue
in interfacePrismProperty<T>
-
getValueClass
public Class<T> getValueClass()
- Specified by:
getValueClass
in interfacePrismProperty<T>
-
createDelta
public PropertyDelta<T> 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<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
- Specified by:
createDelta
in interfacePrismProperty<T>
-
createDelta
public PropertyDelta<T> createDelta(ItemPath path)
- Specified by:
createDelta
in interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
- Specified by:
createDelta
in interfacePrismProperty<T>
-
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<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
findPartial
public <IV extends PrismValue,ID extends ItemDefinition> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path)
- Specified by:
findPartial
in interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
- Specified by:
findPartial
in interfacePrismProperty<T>
-
diff
public PropertyDelta<T> diff(PrismProperty<T> other)
- Specified by:
diff
in interfacePrismProperty<T>
-
diff
public PropertyDelta<T> diff(PrismProperty<T> other, ParameterizedEquivalenceStrategy strategy)
- Specified by:
diff
in interfacePrismProperty<T>
-
checkDefinition
protected void checkDefinition(PrismPropertyDefinition<T> def)
- Specified by:
checkDefinition
in classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
clone
public PrismProperty<T> clone()
Description copied from interface:Item
Literal clone.- Specified by:
clone
in interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
- Specified by:
clone
in interfacePrismProperty<T>
- Specified by:
clone
in classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
createImmutableClone
public PrismProperty<T> createImmutableClone()
- Specified by:
createImmutableClone
in interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
- Specified by:
createImmutableClone
in interfacePrismProperty<T>
- Overrides:
createImmutableClone
in classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
cloneComplex
public PrismProperty<T> cloneComplex(CloneStrategy strategy)
Description copied from interface:Item
Complex clone with different cloning strategies.- Specified by:
cloneComplex
in interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
- Specified by:
cloneComplex
in interfacePrismProperty<T>
- See Also:
CloneStrategy
-
copyValues
protected void copyValues(CloneStrategy strategy, PrismPropertyImpl<T> clone)
-
fixupDelta
protected ItemDelta fixupDelta(ItemDelta delta, Item otherItem)
- Overrides:
fixupDelta
in classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
toString
public String toString()
- Overrides:
toString
in classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
- Overrides:
debugDump
in classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
toHumanReadableString
public String toHumanReadableString()
- Specified by:
toHumanReadableString
in interfacePrismProperty<T>
-
getDebugDumpClassName
protected String getDebugDumpClassName()
Return a human readable name of this class suitable for logs.- Overrides:
getDebugDumpClassName
in classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
-