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 voidaddRealValue(T valueToAdd)voidaddRealValues(T... valuesToAdd)voidaddValue(PrismPropertyValue<T> pValueToAdd)voidaddValues(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)StringdebugDump(int indent)booleandeleteValue(PrismPropertyValue<T> pValueToDelete)booleandeleteValues(Collection<PrismPropertyValue<T>> pValuesToDelete)PropertyDelta<T>diff(PrismProperty<T> other)PropertyDelta<T>diff(PrismProperty<T> other, ParameterizedEquivalenceStrategy strategy)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)TgetAnyRealValue()PrismPropertyDefinition<T>getDefinition()Returns applicable property definition.TgetRealValue()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> TgetRealValue(PrismProperty<T> property)<X> XgetRealValue(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.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.StringtoHumanReadableString()StringtoString()-
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:
getDefinitionin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Specified by:
getDefinitionin interfaceItemable- Returns:
- applicable property definition
-
setDefinition
void setDefinition(PrismPropertyDefinition<T> definition)
Sets applicable property definition. TODO remove (method in Item is sufficient)- Specified by:
setDefinitionin 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: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<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
getRealValues
@NotNull Collection<T> getRealValues()
Description copied from interface:ItemReturns (potentially empty) collection of "real values".- Specified by:
getRealValuesin 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: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>>
-
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: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>>
-
createDelta
PropertyDelta<T> createDelta(ItemPath path)
- Specified by:
createDeltain interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
find
Object find(ItemPath path)
Description copied from interface:ItemReturns object (Item or PrismValue) pointed to by the given path.- Specified by:
findin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
findPartial
<IV extends PrismValue,ID extends ItemDefinition> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path)
- Specified by:
findPartialin 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:ItemLiteral clone.- Specified by:
clonein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
cloneComplex
PrismProperty<T> cloneComplex(CloneStrategy strategy)
Description copied from interface:ItemComplex clone with different cloning strategies.- Specified by:
cloneComplexin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- See Also:
CloneStrategy
-
debugDump
String debugDump(int indent)
- Specified by:
debugDumpin interfaceDebugDumpable
-
toHumanReadableString
String toHumanReadableString()
-
getRealValue
static <T> T getRealValue(PrismProperty<T> property)
-
-