Class DummyPropertyImpl<T>
- java.lang.Object
-
- com.evolveum.midpoint.prism.impl.item.DummyPropertyImpl<T>
-
- All Implemented Interfaces:
Item<PrismPropertyValue<T>,PrismPropertyDefinition<T>>,Itemable,ParentVisitable,PathVisitable,PrismProperty<T>,Revivable,Visitable,DebugDumpable,Serializable
public class DummyPropertyImpl<T> extends Object implements PrismProperty<T>
- Author:
- semancik
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Constructor Summary
Constructors Constructor Description DummyPropertyImpl(PrismProperty<T> realProperty, ItemPath path)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Visitor visitor)voidaccept(Visitor visitor, ItemPath path, boolean recursive)voidacceptParentVisitor(Visitor visitor)Accepts a visitor that visits each item/value on the way to the structure root.booleanadd(PrismPropertyValue<T> newValue)Adds a given value, unless an equivalent one is already there.booleanadd(PrismPropertyValue<T> newValue, boolean checkUniqueness)Adds a given value, unless an equivalent one is already there (if checkUniqueness is true).booleanadd(PrismPropertyValue<T> newValue, EquivalenceStrategy equivalenceStrategy)Adds a given value, unless an equivalent one is already there.booleanaddAll(Collection<PrismPropertyValue<T>> newValues)Adds given values, with the same semantics as repeated add(..) calls.booleanaddAll(Collection<PrismPropertyValue<T>> newValues, EquivalenceStrategy strategy)Adds given values, with the same semantics as repeated add(..) calls.voidaddRealValue(T valueToAdd)voidaddRealValues(T... valuesToAdd)voidaddRealValueSkipUniquenessCheck(T valueToAdd)voidaddValue(PrismPropertyValue<T> pValueToAdd)voidaddValues(Collection<PrismPropertyValue<T>> pValuesToAdd)voidapplyDefinition(PrismPropertyDefinition<T> definition)voidapplyDefinition(PrismPropertyDefinition<T> definition, boolean force)voidassertDefinitions()voidassertDefinitions(boolean tolerateRawValues, String sourceDescription)voidassertDefinitions(String sourceDescription)voidcheckConsistence()voidcheckConsistence(boolean requireDefinitions, boolean prohibitRaw)voidcheckConsistence(boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)voidcheckConsistence(boolean requireDefinitions, ConsistencyCheckScope scope)voidcheckConsistence(ConsistencyCheckScope scope)voidcheckConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)voidcheckImmutability()voidclear()Removes all values from the item.PrismProperty<T>clone()Literal clone.PrismProperty<T>cloneComplex(CloneStrategy strategy)Complex clone with different cloning strategies.booleancontains(PrismPropertyValue<T> value)booleancontains(PrismPropertyValue<T> value, EquivalenceStrategy strategy)booleancontains(PrismPropertyValue<T> value, EquivalenceStrategy strategy, Comparator<PrismPropertyValue<T>> comparator)booleancontainsEquivalentValue(PrismPropertyValue<T> value)booleancontainsEquivalentValue(PrismPropertyValue<T> value, Comparator<PrismPropertyValue<T>> comparator)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)ItemDelta<PrismPropertyValue<T>,PrismPropertyDefinition<T>>diff(Item<PrismPropertyValue<T>,PrismPropertyDefinition<T>> other, ParameterizedEquivalenceStrategy strategy)Computes a difference (delta) with the specified item using given equivalence strategy.PropertyDelta<T>diff(PrismProperty<T> other)PropertyDelta<T>diff(PrismProperty<T> other, ParameterizedEquivalenceStrategy strategy)booleanequals(Object obj)Compares this item to the specified object under NOT_LITERAL strategy (if no other is pre-set).booleanequals(Object obj, EquivalenceStrategy equivalenceStrategy)Compares this item to the specified object under given strategy.booleanequals(Object obj, ParameterizedEquivalenceStrategy equivalenceStrategy)Compares this item to the specified object under given strategy.voidfilterValues(Function<PrismPropertyValue<T>,Boolean> function)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)PrismPropertyValue<T>findValue(PrismPropertyValue<T> value, EquivalenceStrategy strategy)Collection<PrismValue>getAllValues(ItemPath path)TgetAnyRealValue()PrismPropertyValue<T>getAnyValue()Returns any of the values.Collection<PrismPropertyValue<T>>getClonedValues()PrismPropertyDefinition<T>getDefinition()Returns applicable property definition.StringgetDisplayName()Returns a display name for the item.ItemNamegetElementName()Returns the name of the item.StringgetHelp()Returns help message defined for the item.LonggetHighestId()PrismContainerValue<?>getParent()Returns the parent of this item (if exists).ItemPathgetPath()Returns the path of this item (sequence of names from the "root" container or similar object to this item).PrismContextgetPrismContext()PrismContextgetPrismContextLocal()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.<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.Map<String,Object>getUserData()Returns the "user data", a map that allows attaching arbitrary named data to this item.<T> TgetUserData(String key)Returns the user data for the given key (name).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()List<PrismPropertyValue<T>>getValues()Returns the values for this item.<X> List<PrismPropertyValue<X>>getValues(Class<X> type)Type override, also for compatibility.booleanhasCompleteDefinition()Returns true if this item and all contained items have proper definition.inthashCode()Computes hash code to be used under NOT_LITERAL equivalence strategy.inthashCode(EquivalenceStrategy equivalenceStrategy)Computes hash code to be used under given equivalence strategy.inthashCode(ParameterizedEquivalenceStrategy equivalenceStrategy)Computes hash code to be used under given equivalence strategy.booleanhasNoValues()booleanhasRaw()Returns true is at least one of the values is raw.booleanhasRealValue(PrismPropertyValue<T> value)booleanisEmpty()booleanisImmutable()booleanisIncomplete()Flag that indicates incomplete item.booleanisOperational()Returns true if this item is metadata item that should be ignored for metadata-insensitive comparisons and hashCode functions.booleanisRaw()Returns true is all the values are raw.booleanisSingleValue()Returns true if the item contains 0 or 1 values and (by definition) is not multivalued.voidmerge(Item<PrismPropertyValue<T>,PrismPropertyDefinition<T>> otherItem)Merge all the values of other item to this item.voidmodifyUnfrozen(Runnable mutator)voidmodifyUnfrozen(Consumer<Item<PrismPropertyValue<T>,PrismPropertyDefinition<T>>> mutator)voidnormalize()voidrecomputeAllValues()Re-apply PolyString (and possible other) normalizations to the object.booleanremove(PrismPropertyValue<T> value)Removes given value from the item.booleanremove(PrismPropertyValue<T> value, EquivalenceStrategy strategy)Removes values equivalent to given value from the item; under specified equivalence strategy OR when values represent the same value via "representsSameValue(.., lax=false)" method.booleanremoveAll(Collection<PrismPropertyValue<T>> values)Removes all given values from the item.voidreplace(PrismPropertyValue<T> newValue)Replaces all values of the item by given value.voidreplaceAll(Collection<PrismPropertyValue<T>> newValues, EquivalenceStrategy strategy)Replaces all values of the item by given values.voidreplaceValues(Collection<PrismPropertyValue<T>> valuesToReplace)voidrevive(PrismContext prismContext)voidsetDefinition(PrismPropertyDefinition<T> definition)Sets applicable property definition.voidsetElementName(QName elementName)Sets the name of the item.voidsetImmutable(boolean immutable)voidsetIncomplete(boolean incomplete)Flags the item as incomplete.voidsetParent(PrismContainerValue<?> parentValue)Sets the parent of this item.voidsetPrismContext(PrismContext prismContext)voidsetRealValue(T realValue)voidsetRealValues(T... realValues)voidsetUserData(String key, Object value)Sets the user data for the given key (name).voidsetValue(PrismPropertyValue<T> value)Means as a short-hand for setting just a value for single-valued attributes.intsize()Returns the number of values for this item.StringtoHumanReadableString()StringtoString()booleanvaluesEqual(Collection<PrismPropertyValue<T>> matchValues, Comparator<PrismPropertyValue<T>> comparator)-
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
diff, getRealValuesOrRawTypes
-
-
-
-
Constructor Detail
-
DummyPropertyImpl
public DummyPropertyImpl(PrismProperty<T> realProperty, @NotNull ItemPath path)
-
-
Method Detail
-
accept
public void accept(Visitor visitor, ItemPath path, boolean recursive)
- Specified by:
acceptin interfacePathVisitable
-
getDefinition
public PrismPropertyDefinition<T> getDefinition()
Description copied from interface:PrismPropertyReturns 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- Specified by:
getDefinitionin interfacePrismProperty<T>- Returns:
- applicable property definition
-
hasCompleteDefinition
public boolean hasCompleteDefinition()
Description copied from interface:ItemReturns true if this item and all contained items have proper definition.- Specified by:
hasCompleteDefinitionin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
setDefinition
public void setDefinition(PrismPropertyDefinition<T> definition)
Description copied from interface:PrismPropertySets applicable property definition. TODO remove (method in Item is sufficient)- Specified by:
setDefinitionin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Specified by:
setDefinitionin interfacePrismProperty<T>- Parameters:
definition- the definition to set
-
getElementName
public ItemName getElementName()
Description copied from interface:ItemReturns the name of the item.The name is a QName. It uniquely defines an item.
The name may be null, but such an item will not work.
The name is the QName of XML element in the XML representation.
- Specified by:
getElementNamein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Specified by:
getElementNamein interfaceItemable- Returns:
- item name TODO consider making element name obligatory
-
getValues
public <X> List<PrismPropertyValue<X>> getValues(Class<X> type)
Description copied from interface:PrismPropertyType override, also for compatibility.- Specified by:
getValuesin interfacePrismProperty<T>
-
getValue
public 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>>- Specified by:
getValuein interfacePrismProperty<T>
-
getRealValues
@NotNull public Collection<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>
-
setElementName
public void setElementName(QName elementName)
Description copied from interface:ItemSets the name of the item.The name is a QName. It uniquely defines an item.
The name may be null, but such an item will not work.
The name is the QName of XML element in the XML representation.
- Specified by:
setElementNamein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Parameters:
elementName- the name to set TODO consider removing this method
-
getRealValues
public <X> Collection<X> getRealValues(Class<X> type)
Description copied from interface:PrismPropertyType override, also for compatibility.- Specified by:
getRealValuesin interfacePrismProperty<T>
-
getAnyRealValue
public T getAnyRealValue()
- Specified by:
getAnyRealValuein interfacePrismProperty<T>
-
getRealValue
public 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>
-
getRealValue
public <X> X getRealValue(Class<X> type)
Description copied from interface:PrismPropertyType override, also for compatibility.- Specified by:
getRealValuein interfacePrismProperty<T>
-
getRealValuesArray
public <X> X[] getRealValuesArray(Class<X> type)
Description copied from interface:PrismPropertyType override, also for compatibility.- Specified by:
getRealValuesArrayin interfacePrismProperty<T>
-
getValue
public <X> PrismPropertyValue<X> getValue(Class<X> type)
Description copied from interface:PrismPropertyType override, also for compatibility.- Specified by:
getValuein interfacePrismProperty<T>
-
setValue
public void setValue(PrismPropertyValue<T> value)
Description copied from interface:PrismPropertyMeans as a short-hand for setting just a value for single-valued attributes. Will remove all existing values.- Specified by:
setValuein interfacePrismProperty<T>
-
getDisplayName
public String getDisplayName()
Description copied from interface:ItemReturns a display name for the item.Returns null if the display name cannot be determined.
The display name is fetched from the definition. If no definition (schema) is available, the display name will not be returned.
- Specified by:
getDisplayNamein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- display name for the item
-
setRealValue
public void setRealValue(T realValue)
- Specified by:
setRealValuein interfacePrismProperty<T>
-
setRealValues
public void setRealValues(T... realValues)
- Specified by:
setRealValuesin interfacePrismProperty<T>
-
addValues
public void addValues(Collection<PrismPropertyValue<T>> pValuesToAdd)
- Specified by:
addValuesin interfacePrismProperty<T>
-
addValue
public void addValue(PrismPropertyValue<T> pValueToAdd)
- Specified by:
addValuein interfacePrismProperty<T>
-
addRealValue
public void addRealValue(T valueToAdd)
- Specified by:
addRealValuein interfacePrismProperty<T>
-
addRealValueSkipUniquenessCheck
public void addRealValueSkipUniquenessCheck(T valueToAdd)
- Specified by:
addRealValueSkipUniquenessCheckin interfacePrismProperty<T>
-
addRealValues
public void addRealValues(T... valuesToAdd)
- Specified by:
addRealValuesin interfacePrismProperty<T>
-
getHelp
public String getHelp()
Description copied from interface:ItemReturns help message defined for the item.Returns null if the help message cannot be determined.
The help message is fetched from the definition. If no definition (schema) is available, the help message will not be returned.
- Specified by:
getHelpin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- help message for the item
-
deleteValues
public boolean deleteValues(Collection<PrismPropertyValue<T>> pValuesToDelete)
- Specified by:
deleteValuesin interfacePrismProperty<T>
-
deleteValue
public boolean deleteValue(PrismPropertyValue<T> pValueToDelete)
- Specified by:
deleteValuein interfacePrismProperty<T>
-
replaceValues
public void replaceValues(Collection<PrismPropertyValue<T>> valuesToReplace)
- Specified by:
replaceValuesin interfacePrismProperty<T>
-
hasRealValue
public boolean hasRealValue(PrismPropertyValue<T> value)
- Specified by:
hasRealValuein interfacePrismProperty<T>
-
getValueClass
public Class<T> getValueClass()
- Specified by:
getValueClassin interfacePrismProperty<T>
-
createDelta
public 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>>- Specified by:
createDeltain interfacePrismProperty<T>
-
createDelta
public PropertyDelta<T> createDelta(ItemPath path)
- Specified by:
createDeltain interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Specified by:
createDeltain interfacePrismProperty<T>
-
isIncomplete
public boolean isIncomplete()
Description copied from interface:ItemFlag that indicates incomplete item. If set to true then the values in this item are not complete. If this flag is true then it can be assumed that the object that this item represents has at least one value. This is a method how to indicate that the item really has some values, but are not here. This may be used for variety of purposes. It may indicate that the account has a password, but the password value is not revealed. This may indicate that a user has a photo, but the photo was not requested and therefore is not returned. This may be used to indicate that only part of the attribute values were returned from the search. And so on.- Specified by:
isIncompletein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
find
public 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>>- Specified by:
findin interfacePrismProperty<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
public PropertyDelta<T> diff(PrismProperty<T> other)
- Specified by:
diffin interfacePrismProperty<T>
-
diff
public PropertyDelta<T> diff(PrismProperty<T> other, ParameterizedEquivalenceStrategy strategy)
- Specified by:
diffin interfacePrismProperty<T>
-
clone
public PrismProperty<T> clone()
Description copied from interface:ItemLiteral clone.- Specified by:
clonein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Specified by:
clonein interfacePrismProperty<T>- Overrides:
clonein classObject
-
cloneComplex
public PrismProperty<T> cloneComplex(CloneStrategy strategy)
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:
CloneStrategy
-
toString
public String toString()
- Specified by:
toStringin interfacePrismProperty<T>- Overrides:
toStringin classObject
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDumpin interfaceDebugDumpable- Specified by:
debugDumpin interfacePrismProperty<T>
-
toHumanReadableString
public String toHumanReadableString()
- Specified by:
toHumanReadableStringin interfacePrismProperty<T>
-
setIncomplete
public void setIncomplete(boolean incomplete)
Description copied from interface:ItemFlags the item as incomplete.- Specified by:
setIncompletein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Parameters:
incomplete- The new value- See Also:
Item.isIncomplete()
-
getParent
public PrismContainerValue<?> getParent()
Description copied from interface:ItemReturns the parent of this item (if exists). Currently this has to be a PrismContainerValue.- Specified by:
getParentin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- The parent if exists
-
setParent
public void setParent(PrismContainerValue<?> parentValue)
Description copied from interface:ItemSets the parent of this item.- Specified by:
setParentin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Parameters:
parentValue- The new parent
-
getPath
@NotNull public ItemPath getPath()
Description copied from interface:ItemReturns the path of this item (sequence of names from the "root" container or similar object to this item). Note that if the containing object is a delta (usually a container delta), then the path- Specified by:
getPathin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Specified by:
getPathin interfaceItemable- Returns:
- the path
-
getUserData
@NotNull public Map<String,Object> getUserData()
Description copied from interface:ItemReturns the "user data", a map that allows attaching arbitrary named data to this item.- Specified by:
getUserDatain interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- the user data map
-
getUserData
public <T> T getUserData(String key)
Description copied from interface:ItemReturns the user data for the given key (name).- Specified by:
getUserDatain interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
setUserData
public void setUserData(String key, Object value)
Description copied from interface:ItemSets the user data for the given key (name).- Specified by:
setUserDatain interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
getValues
@NotNull public List<PrismPropertyValue<T>> getValues()
Description copied from interface:ItemReturns the values for this item. Although the ordering of this values is not important, and each value should be present at most once, we currently return them as a list instead of a set. TODO reconsider this- Specified by:
getValuesin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
size
public int size()
Description copied from interface:ItemReturns the number of values for this item.- Specified by:
sizein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
getAnyValue
public PrismPropertyValue<T> getAnyValue()
Description copied from interface:ItemReturns any of the values. Usually called when we are quite confident that there is only a single value; or we don't care which of the values we get. Does not create values if there are none.- Specified by:
getAnyValuein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
isSingleValue
public boolean isSingleValue()
Description copied from interface:ItemReturns true if the item contains 0 or 1 values and (by definition) is not multivalued.- Specified by:
isSingleValuein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
add
public boolean add(@NotNull PrismPropertyValue<T> newValue, boolean checkUniqueness) throws SchemaExceptionDescription copied from interface:ItemAdds a given value, unless an equivalent one is already there (if checkUniqueness is true).- Specified by:
addin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- true if this item changed as a result of the call (i.e. if the value was really added) Note that even if checkUniqueness is false we check the cardinality of the item according to its definition, i.e. we do not allow single-valued item to contain more than one value.
- Throws:
SchemaException
-
add
public boolean add(@NotNull PrismPropertyValue<T> newValue) throws SchemaExceptionDescription copied from interface:ItemAdds a given value, unless an equivalent one is already there. It is the same as calling add with checkUniqueness=true.- Specified by:
addin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- true if this item changed as a result of the call (i.e. if the value was really added)
- Throws:
SchemaException
-
add
public boolean add(@NotNull PrismPropertyValue<T> newValue, @NotNull EquivalenceStrategy equivalenceStrategy) throws SchemaExceptionDescription copied from interface:ItemAdds a given value, unless an equivalent one is already there. It is the same as calling add with checkUniqueness=true. Uses given strategy for equivalence testing.- Specified by:
addin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- true if this item changed as a result of the call (i.e. if the value was really added)
- Throws:
SchemaException
-
addAll
public boolean addAll(Collection<PrismPropertyValue<T>> newValues) throws SchemaException
Description copied from interface:ItemAdds given values, with the same semantics as repeated add(..) calls.- Specified by:
addAllin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- true if this item changed as a result of the call (i.e. if at least one value was really added)
- Throws:
SchemaException
-
addAll
public boolean addAll(Collection<PrismPropertyValue<T>> newValues, EquivalenceStrategy strategy) throws SchemaException
Description copied from interface:ItemAdds given values, with the same semantics as repeated add(..) calls. For equality testing uses give strategy.- Specified by:
addAllin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- true if this item changed as a result of the call (i.e. if at least one value was really added)
- Throws:
SchemaException
-
remove
public boolean remove(PrismPropertyValue<T> value)
Description copied from interface:ItemRemoves given value from the item. "Given value" currently means any value that is considered equivalent via REAL_VALUE equivalence strategy or a value that is considered "the same" via "representsSameValue(.., lax=false)" method.- Specified by:
removein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- true if this item changed as a result of the call (i.e. if at least one value was really removed) Note that there can be more than one values removed.
-
remove
public boolean remove(PrismPropertyValue<T> value, @NotNull EquivalenceStrategy strategy)
Description copied from interface:ItemRemoves values equivalent to given value from the item; under specified equivalence strategy OR when values represent the same value via "representsSameValue(.., lax=false)" method.- Specified by:
removein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- true if this item changed as a result of the call (i.e. if at least one value was really removed)
-
removeAll
public boolean removeAll(Collection<PrismPropertyValue<T>> values)
Description copied from interface:ItemRemoves all given values from the item. It is basically a shortcut for repeated remove(value) call.- Specified by:
removeAllin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- true if this item changed as a result of the call (i.e. if at least one value was really removed)
-
clear
public void clear()
Description copied from interface:ItemRemoves all values from the item.- Specified by:
clearin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
replaceAll
public void replaceAll(Collection<PrismPropertyValue<T>> newValues, EquivalenceStrategy strategy) throws SchemaException
Description copied from interface:ItemReplaces all values of the item by given values.- Specified by:
replaceAllin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Throws:
SchemaException
-
replace
public void replace(PrismPropertyValue<T> newValue) throws SchemaException
Description copied from interface:ItemReplaces all values of the item by given value.- Specified by:
replacein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Throws:
SchemaException
-
equals
public boolean equals(Object obj)
Description copied from interface:ItemCompares this item to the specified object under NOT_LITERAL strategy (if no other is pre-set).- Specified by:
equalsin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Overrides:
equalsin classObject
-
equals
public boolean equals(Object obj, @NotNull EquivalenceStrategy equivalenceStrategy)
Description copied from interface:ItemCompares this item to the specified object under given strategy.- Specified by:
equalsin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
equals
public boolean equals(Object obj, @NotNull ParameterizedEquivalenceStrategy equivalenceStrategy)
Description copied from interface:ItemCompares this item to the specified object under given strategy.- Specified by:
equalsin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
hashCode
public int hashCode()
Description copied from interface:ItemComputes hash code to be used under NOT_LITERAL equivalence strategy.- Specified by:
hashCodein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Overrides:
hashCodein classObject
-
hashCode
public int hashCode(@NotNull EquivalenceStrategy equivalenceStrategy)Description copied from interface:ItemComputes hash code to be used under given equivalence strategy.- Specified by:
hashCodein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
hashCode
public int hashCode(@NotNull ParameterizedEquivalenceStrategy equivalenceStrategy)Description copied from interface:ItemComputes hash code to be used under given equivalence strategy.- Specified by:
hashCodein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
contains
public boolean contains(PrismPropertyValue<T> value)
- Specified by:
containsin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- true if the item contains a given value (by default using NOT_LITERAL strategy) Note that the "sameness" (ID-only value matching) is NOT considered here.
-
contains
public boolean contains(PrismPropertyValue<T> value, @NotNull EquivalenceStrategy strategy)
- Specified by:
containsin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- true if the item contains a given value under specified equivalence strategy Note that the "sameness" (ID-only value matching) is NOT considered here.
-
contains
public boolean contains(PrismPropertyValue<T> value, EquivalenceStrategy strategy, Comparator<PrismPropertyValue<T>> comparator)
- Specified by:
containsin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- true if the item contains a given value using comparator (if not null) or under specified equivalence strategy (if comparator is null). Note that the "sameness" (ID-only value matching) is NOT considered here.
-
containsEquivalentValue
public boolean containsEquivalentValue(PrismPropertyValue<T> value)
- Specified by:
containsEquivalentValuein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- true if the item contains an equivalent value (the same as
Item.containsEquivalentValue(PrismValue, Comparator)with comparator being null)
-
containsEquivalentValue
public boolean containsEquivalentValue(PrismPropertyValue<T> value, Comparator<PrismPropertyValue<T>> comparator)
- Specified by:
containsEquivalentValuein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- true if the item contains an equivalent value Item value is considered to be equivalent to the given value if: 1) given value is ID-only container value and item value has the same ID, or 2) comparator is not null and it gives "equals" (0) result when comparing these values, or 3) comparator is null and values match under IGNORE_METADATA_CONSIDER_DIFFERENT_IDS strategy
-
findValue
public PrismPropertyValue<T> findValue(PrismPropertyValue<T> value, @NotNull EquivalenceStrategy strategy)
- Specified by:
findValuein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- a value of this item that is equivalent to the given one under given equivalence strategy (or null if no such value exists)
-
valuesEqual
public boolean valuesEqual(Collection<PrismPropertyValue<T>> matchValues, Comparator<PrismPropertyValue<T>> comparator)
- Specified by:
valuesEqualin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Returns:
- true if the values of this item match the "matchValues" collection, under given comparator. If comparator is null the default equals(..) comparison is used.
-
diff
public ItemDelta<PrismPropertyValue<T>,PrismPropertyDefinition<T>> diff(Item<PrismPropertyValue<T>,PrismPropertyDefinition<T>> other, @NotNull ParameterizedEquivalenceStrategy strategy)
Description copied from interface:ItemComputes a difference (delta) with the specified item using given equivalence strategy. Note this method cannot accept general EquivalenceStrategy here; it needs the parameterized strategy. Compares item values only -- does NOT dive into lower levels.- Specified by:
diffin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
getClonedValues
public Collection<PrismPropertyValue<T>> getClonedValues()
- Specified by:
getClonedValuesin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
normalize
public void normalize()
- Specified by:
normalizein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
merge
public void merge(Item<PrismPropertyValue<T>,PrismPropertyDefinition<T>> otherItem) throws SchemaException
Description copied from interface:ItemMerge all the values of other item to this item.- Specified by:
mergein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Throws:
SchemaException
-
acceptParentVisitor
public void acceptParentVisitor(@NotNull Visitor visitor)Description copied from interface:ItemAccepts a visitor that visits each item/value on the way to the structure root.- Specified by:
acceptParentVisitorin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Specified by:
acceptParentVisitorin interfaceParentVisitable
-
recomputeAllValues
public void recomputeAllValues()
Description copied from interface:ItemRe-apply PolyString (and possible other) normalizations to the object.- Specified by:
recomputeAllValuesin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
filterValues
public void filterValues(Function<PrismPropertyValue<T>,Boolean> function)
- Specified by:
filterValuesin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
applyDefinition
public void applyDefinition(PrismPropertyDefinition<T> definition) throws SchemaException
- Specified by:
applyDefinitionin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Throws:
SchemaException
-
applyDefinition
public void applyDefinition(PrismPropertyDefinition<T> definition, boolean force) throws SchemaException
- Specified by:
applyDefinitionin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Throws:
SchemaException
-
revive
public void revive(PrismContext prismContext) throws SchemaException
- Specified by:
revivein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Specified by:
revivein interfaceRevivable- Throws:
SchemaException
-
checkConsistence
public void checkConsistence(boolean requireDefinitions, ConsistencyCheckScope scope)- Specified by:
checkConsistencein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
checkConsistence
public void checkConsistence(boolean requireDefinitions, boolean prohibitRaw)- Specified by:
checkConsistencein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
checkConsistence
public void checkConsistence(boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)- Specified by:
checkConsistencein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
checkConsistence
public void checkConsistence()
- Specified by:
checkConsistencein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
checkConsistence
public void checkConsistence(ConsistencyCheckScope scope)
- Specified by:
checkConsistencein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
checkConsistenceInternal
public void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
- Specified by:
checkConsistenceInternalin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
assertDefinitions
public void assertDefinitions() throws SchemaException- Specified by:
assertDefinitionsin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Throws:
SchemaException
-
assertDefinitions
public void assertDefinitions(String sourceDescription) throws SchemaException
- Specified by:
assertDefinitionsin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Throws:
SchemaException
-
assertDefinitions
public void assertDefinitions(boolean tolerateRawValues, String sourceDescription) throws SchemaException- Specified by:
assertDefinitionsin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Throws:
SchemaException
-
isRaw
public boolean isRaw()
Description copied from interface:ItemReturns true is all the values are raw.- Specified by:
isRawin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
hasRaw
public boolean hasRaw()
Description copied from interface:ItemReturns true is at least one of the values is raw.- Specified by:
hasRawin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
hasNoValues
public boolean hasNoValues()
- Specified by:
hasNoValuesin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
isOperational
public boolean isOperational()
Description copied from interface:ItemReturns true if this item is metadata item that should be ignored for metadata-insensitive comparisons and hashCode functions.- Specified by:
isOperationalin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
isImmutable
public boolean isImmutable()
- Specified by:
isImmutablein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
setImmutable
public void setImmutable(boolean immutable)
- Specified by:
setImmutablein interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
checkImmutability
public void checkImmutability()
- Specified by:
checkImmutabilityin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
modifyUnfrozen
public void modifyUnfrozen(Runnable mutator)
- Specified by:
modifyUnfrozenin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
modifyUnfrozen
public void modifyUnfrozen(Consumer<Item<PrismPropertyValue<T>,PrismPropertyDefinition<T>>> mutator)
- Specified by:
modifyUnfrozenin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
getAllValues
@NotNull public Collection<PrismValue> getAllValues(ItemPath path)
- Specified by:
getAllValuesin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
getPrismContext
public PrismContext getPrismContext()
- Specified by:
getPrismContextin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>- Specified by:
getPrismContextin interfaceItemable
-
getPrismContextLocal
public PrismContext getPrismContextLocal()
- Specified by:
getPrismContextLocalin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
setPrismContext
public void setPrismContext(PrismContext prismContext)
- Specified by:
setPrismContextin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
getHighestId
public Long getHighestId()
- Specified by:
getHighestIdin interfaceItem<PrismPropertyValue<T>,PrismPropertyDefinition<T>>
-
-