Package com.evolveum.midpoint.prism
Interface PrismProperty<T>
-
- All Superinterfaces:
DebugDumpable
,Item<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
,Itemable
,ParentVisitable
,PathVisitable
,Revivable
,Serializable
,Visitable
- All Known Subinterfaces:
ResourceAttribute<T>
- All Known Implementing Classes:
DummyPropertyImpl
,PrismPropertyImpl
,ResourceAttributeImpl
public interface PrismProperty<T> extends Item<PrismPropertyValue<T>,PrismPropertyDefinition<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
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addRealValue(T valueToAdd)
void
addRealValues(T... valuesToAdd)
void
addValue(PrismPropertyValue<T> pValueToAdd)
void
addValues(Collection<PrismPropertyValue<T>> pValuesToAdd)
PrismProperty<T>
clone()
Literal clone.PrismProperty<T>
cloneComplex(CloneStrategy strategy)
Complex clone with different cloning strategies.PropertyDelta<T>
createDelta()
Creates specific subclass of ItemDelta appropriate for type of item that this definition represents (e.g.PropertyDelta<T>
createDelta(ItemPath path)
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)
T
getAnyRealValue()
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.static <T> T
getRealValue(PrismProperty<T> property)
<X> X
getRealValue(Class<X> type)
Type override, also for compatibility.Collection<T>
getRealValues()
Returns (potentially empty) collection of "real values".<X> Collection<X>
getRealValues(Class<X> type)
Type override, also for compatibility.<X> X[]
getRealValuesArray(Class<X> type)
Type override, also for compatibility.PrismPropertyValue<T>
getValue()
Returns the value, if there is only one.<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 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, getDisplayName, getElementName, getHelp, getHighestId, getParent, getPath, getPrismContext, getPrismContextLocal, 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, setElementName, setImmutable, setIncomplete, setParent, setPrismContext, setUserData, size, valuesEqual
-
Methods inherited from interface com.evolveum.midpoint.prism.PathVisitable
accept
-
-
-
-
Method Detail
-
getDefinition
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
- Returns:
- applicable property definition
-
setDefinition
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>>
- Parameters:
definition
- the definition to set
-
getValues
<X> List<PrismPropertyValue<X>> getValues(Class<X> type)
Type override, also for compatibility.
-
getValue
PrismPropertyValue<T> getValue()
Description copied from interface:Item
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<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
getRealValues
@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>>
-
getRealValues
<X> Collection<X> getRealValues(Class<X> type)
Type override, also for compatibility.
-
getAnyRealValue
T getAnyRealValue()
-
getRealValue
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>>
-
getRealValue
<X> X getRealValue(Class<X> type)
Type override, also for compatibility.
-
getRealValuesArray
<X> X[] getRealValuesArray(Class<X> type)
Type override, also for compatibility.
-
getValue
<X> PrismPropertyValue<X> getValue(Class<X> type)
Type override, also for compatibility.
-
setValue
void setValue(PrismPropertyValue<T> value)
Means as a short-hand for setting just a value for single-valued attributes. Will remove all existing values.
-
setRealValue
void setRealValue(T realValue)
-
setRealValues
void setRealValues(T... realValues)
-
addValues
void addValues(Collection<PrismPropertyValue<T>> pValuesToAdd)
-
addValue
void addValue(PrismPropertyValue<T> pValueToAdd)
-
addRealValue
void addRealValue(T valueToAdd)
-
addRealValues
void addRealValues(T... valuesToAdd)
-
deleteValues
boolean deleteValues(Collection<PrismPropertyValue<T>> pValuesToDelete)
-
deleteValue
boolean deleteValue(PrismPropertyValue<T> pValueToDelete)
-
replaceValues
void replaceValues(Collection<PrismPropertyValue<T>> valuesToReplace)
-
hasRealValue
boolean hasRealValue(PrismPropertyValue<T> value)
-
createDelta
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>>
-
createDelta
PropertyDelta<T> createDelta(ItemPath path)
- Specified by:
createDelta
in interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
find
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
<IV extends PrismValue,ID extends ItemDefinition> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path)
- Specified by:
findPartial
in interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
diff
PropertyDelta<T> diff(PrismProperty<T> other)
-
diff
PropertyDelta<T> diff(PrismProperty<T> other, ParameterizedEquivalenceStrategy strategy)
-
clone
PrismProperty<T> clone()
Description copied from interface:Item
Literal clone.- Specified by:
clone
in interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
cloneComplex
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>>
- See Also:
CloneStrategy
-
debugDump
String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
-
toHumanReadableString
String toHumanReadableString()
-
getRealValue
static <T> T getRealValue(PrismProperty<T> property)
-
-