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,ItemDefinitionTransformer.TransformableItem,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:
-
Field Summary
Fields inherited from class com.evolveum.midpoint.prism.impl.ItemImpl
definition, elementName, incomplete, parent, valuesFields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Constructor Summary
ConstructorsConstructorDescriptionPrismPropertyImpl(QName name) PrismPropertyImpl(QName name, PrismContext prismContext) PrismPropertyImpl(QName name, PrismPropertyDefinition<T> definition, PrismContext prismContext) -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(@NotNull PrismPropertyValue<T> newValue) Adds a given value, overwriting existing one.voidaddForced(@NotNull PrismPropertyValue<T> newValue) Adds a given value with no checks, no definition application, and so on.protected booleanaddInternalExecution(@NotNull PrismPropertyValue<T> newValue) voidaddRealValue(T valueToAdd) voidaddRealValueSkipUniquenessCheck(T valueToAdd) voidaddValue(PrismPropertyValue<T> pValueToAdd) voidaddValue(PrismPropertyValue<T> pValueToAdd, boolean checkUniqueness) voidaddValues(Collection<PrismPropertyValue<T>> pValuesToAdd) protected voidvoidclear()Removes all values from the item.clone()Literal clone.cloneComplex(CloneStrategy strategy) Complex clone with different cloning strategies.protected voidcopyValues(CloneStrategy strategy, PrismPropertyImpl<T> clone) Creates specific subclass of ItemDelta appropriate for type of item that this definition represents (e.g.createDelta(ItemPath path) debugDump(int indent) booleandeleteValue(PrismPropertyValue<T> pValueToDelete) booleandeleteValues(Collection<PrismPropertyValue<T>> pValuesToDelete) diff(PrismProperty<T> other) diff(PrismProperty<T> other, ParameterizedEquivalenceStrategy strategy) 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<PrismPropertyValue<T>,PrismPropertyDefinition<T>> fixupDelta(ItemDelta<PrismPropertyValue<T>, PrismPropertyDefinition<T>> delta, Item<PrismPropertyValue<T>, PrismPropertyDefinition<T>> otherItem) protected StringReturn a human-readable name of this class suitable for logs.Returns applicable property definition.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>Returns (potentially empty) collection of "real values".<X> Collection<X>getRealValues(Class<X> type) Type override, also for compatibility.<X> PrismPropertyValue<X>Type override, also for compatibility.<X> List<PrismPropertyValue<X>>Type override, also for compatibility.booleanhasRealValue(PrismPropertyValue<T> value) voidreplaceValues(Collection<PrismPropertyValue<T>> valuesToReplace) voidsetDefinition(PrismPropertyDefinition<T> definition) Sets applicable property definition.voidsetRealValue(T realValue) voidsetRealValues(T... realValues) voidsetValue(PrismPropertyValue<T> value) Means as a short-hand for setting just a value for single-valued attributes.toString()protected voidvalueRemoved(PrismPropertyValue<T> currentValue) Methods inherited from class com.evolveum.midpoint.prism.impl.ItemImpl
accept, accept, acceptParentVisitor, add, addAll, addIgnoringEquivalents, addInternal, addRespectingMetadataAndCloning, appendDebugDumpSuffix, applyDefinition, applyDefinition, assertDefinitions, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistenceInternal, copyValues, diff, equals, equals, equals, getAllItems, 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, transformDefinitionMethods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutableMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze, isImmutableMethods inherited from interface com.evolveum.midpoint.prism.Item
acceptParentVisitor, add, addAll, addAll, addIgnoringEquivalents, addRespectingMetadataAndCloning, applyDefinition, applyDefinition, assertDefinitions, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistenceInternal, contains, contains, copy, diff, diff, equals, equals, equals, filterValues, filterYields, findValue, findValue, getAllItems, 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, valuesStreamMethods inherited from interface com.evolveum.midpoint.prism.PathVisitable
acceptMethods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContextMethods inherited from interface com.evolveum.midpoint.prism.PrismProperty
addRealValues
-
Constructor Details
-
PrismPropertyImpl
-
PrismPropertyImpl
-
PrismPropertyImpl
public PrismPropertyImpl(QName name, PrismPropertyDefinition<T> definition, PrismContext prismContext)
-
-
Method Details
-
getDefinition
Returns applicable property definition.May return null if no definition is applicable or the definition is not know.
- Specified by:
getDefinitionin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Specified by:
getDefinitionin interfaceItemable- Overrides:
getDefinitionin classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Returns:
- applicable property definition
-
setDefinition
Sets applicable property definition. TODO remove (method in Item is sufficient)- Specified by:
setDefinitionin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Overrides:
setDefinitionin classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Parameters:
definition- the definition to set
-
getValues
Type override, also for compatibility.- Specified by:
getValuesin interfacePrismProperty<T>
-
getRealValues
Description copied from interface:ItemReturns (potentially empty) collection of "real values".- Specified by:
getRealValuesin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Specified by:
getRealValuesin interfacePrismProperty<T>
-
getRealValues
Type override, also for compatibility.- Specified by:
getRealValuesin interfacePrismProperty<T>
-
getAnyRealValue
- Specified by:
getAnyRealValuein interfacePrismProperty<T>
-
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<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Specified by:
getRealValuein interfacePrismProperty<T>- Overrides:
getRealValuein classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
getValue
Type override, also for compatibility.- Specified by:
getValuein interfacePrismProperty<T>
-
setValue
Means as a short-hand for setting just a value for single-valued attributes. Will remove all existing values.- Specified by:
setValuein interfacePrismProperty<T>
-
setRealValue
- Specified by:
setRealValuein interfacePrismProperty<T>
-
setRealValues
- Specified by:
setRealValuesin interfacePrismProperty<T>
-
addValues
- Specified by:
addValuesin interfacePrismProperty<T>
-
add
Description copied from interface:ItemAdds a given value, overwriting existing one. It compares values using DEFAULT_FOR_EQUALS (DATA) strategy, so it e.g. takes value metadata differences into account. It is because this method is used during parsing, internal computations (typically using generated beans), and similar situations where we expect little sophistication when it comes to value comparison. The less surprises the better.- Specified by:
addin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Throws:
SchemaException
-
addValue
- Specified by:
addValuein interfacePrismProperty<T>
-
addValue
-
addInternalExecution
- Overrides:
addInternalExecutionin classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
addRealValue
- Specified by:
addRealValuein interfacePrismProperty<T>
-
addRealValueSkipUniquenessCheck
- Specified by:
addRealValueSkipUniquenessCheckin interfacePrismProperty<T>
-
deleteValues
- Specified by:
deleteValuesin interfacePrismProperty<T>
-
deleteValue
- Specified by:
deleteValuein interfacePrismProperty<T>
-
replaceValues
- Specified by:
replaceValuesin interfacePrismProperty<T>
-
hasRealValue
- Specified by:
hasRealValuein interfacePrismProperty<T>
-
getValueClass
- Specified by:
getValueClassin interfacePrismProperty<T>
-
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<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Specified by:
createDeltain interfacePrismProperty<T>
-
createDelta
- Specified by:
createDeltain interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Specified by:
createDeltain interfacePrismProperty<T>
-
find
Description copied from interface:ItemReturns object (Item or PrismValue) pointed to by the given path.- Specified by:
findin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
findPartial
public <IV extends PrismValue,ID extends ItemDefinition<?>> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path) - Specified by:
findPartialin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Specified by:
findPartialin interfacePrismProperty<T>
-
diff
- Specified by:
diffin interfacePrismProperty<T>
-
diff
- Specified by:
diffin interfacePrismProperty<T>
-
checkDefinition
- Specified by:
checkDefinitionin classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
clone
Description copied from interface:ItemLiteral clone.- Specified by:
clonein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Specified by:
clonein interfacePrismProperty<T>- Specified by:
clonein classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
createImmutableClone
- Specified by:
createImmutableClonein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Specified by:
createImmutableClonein interfacePrismProperty<T>- Overrides:
createImmutableClonein classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
cloneComplex
Description copied from interface:ItemComplex clone with different cloning strategies.- Specified by:
cloneComplexin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Specified by:
cloneComplexin interfacePrismProperty<T>- See Also:
-
copyValues
-
fixupDelta
protected ItemDelta<PrismPropertyValue<T>,PrismPropertyDefinition<T>> fixupDelta(ItemDelta<PrismPropertyValue<T>, PrismPropertyDefinition<T>> delta, Item<PrismPropertyValue<T>, PrismPropertyDefinition<T>> otherItem) - Overrides:
fixupDeltain classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
toString
- Overrides:
toStringin classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
debugDump
- Specified by:
debugDumpin interfaceDebugDumpable- Overrides:
debugDumpin classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
toHumanReadableString
- Specified by:
toHumanReadableStringin interfacePrismProperty<T>
-
getDebugDumpClassName
Return a human-readable name of this class suitable for logs.- Overrides:
getDebugDumpClassNamein classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
addForced
Description copied from class:ItemImplAdds a given value with no checks, no definition application, and so on. For internal use only.- Overrides:
addForcedin classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
valueRemoved
- Overrides:
valueRemovedin classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
clear
public void clear()Description copied from interface:ItemRemoves all values from the item.- Specified by:
clearin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>> - Overrides:
clearin classItemImpl<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-