Package com.evolveum.midpoint.prism.impl
Class ItemImpl<V extends PrismValue,D extends ItemDefinition>
- java.lang.Object
-
- com.evolveum.midpoint.prism.AbstractFreezable
-
- com.evolveum.midpoint.prism.impl.ItemImpl<V,D>
-
- All Implemented Interfaces:
Freezable
,Item<V,D>
,Itemable
,ParentVisitable
,PathVisitable
,PrismContextSensitive
,Revivable
,Visitable
,DebugDumpable
,Serializable
- Direct Known Subclasses:
PrismContainerImpl
,PrismPropertyImpl
,PrismReferenceImpl
public abstract class ItemImpl<V extends PrismValue,D extends ItemDefinition> extends AbstractFreezable implements Item<V,D>
Item is a common abstraction of Property and PropertyContainer.This is supposed to be a superclass for all items. Items are things that can appear in property containers, which generally means only a property and property container itself. Therefore this is in fact superclass for those two definitions.
- Author:
- Radovan Semancik
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected EquivalenceStrategy
defaultEquivalenceStrategy
protected D
definition
protected ItemName
elementName
protected boolean
immutable
protected boolean
incomplete
protected PrismContainerValue<?>
parent
protected PrismContext
prismContext
protected @NotNull List<V>
values
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
accept(Visitor visitor)
void
accept(Visitor visitor, ItemPath path, boolean recursive)
void
acceptParentVisitor(@NotNull Visitor visitor)
Accepts a visitor that visits each item/value on the way to the structure root.boolean
add(V newValue, boolean checkUniqueness)
Adds a given value, unless an equivalent one is already there (if checkUniqueness is true).boolean
add(V newValue, boolean checkUniqueness, EquivalenceStrategy equivalenceStrategy)
boolean
add(V newValue, @NotNull EquivalenceStrategy equivalenceStrategy)
Adds a given value, unless an equivalent one is already there.boolean
addAll(Collection<V> newValues)
Adds given values, with the same semantics as repeated add(..) calls.boolean
addAll(Collection<V> newValues, boolean checkUniqueness, EquivalenceStrategy strategy)
Adds given values, with the same semantics as repeated add(..) calls.boolean
addAll(Collection<V> newValues, EquivalenceStrategy strategy)
Adds given values, with the same semantics as repeated add(..) calls.boolean
addForced(V newValue)
Adds a given value with no checks, no definition application, and so on.protected void
appendDebugDumpSuffix(StringBuilder sb)
void
applyDefinition(D definition)
void
applyDefinition(D definition, boolean force)
void
assertDefinitions()
void
assertDefinitions(boolean tolarateRawValues, String sourceDescription)
void
assertDefinitions(String sourceDescription)
void
checkConsistence()
void
checkConsistence(boolean requireDefinitions, boolean prohibitRaw)
void
checkConsistence(boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
void
checkConsistence(boolean requireDefinitions, ConsistencyCheckScope scope)
void
checkConsistence(ConsistencyCheckScope scope)
void
checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
protected abstract void
checkDefinition(D def)
void
clear()
Removes all values from the item.abstract Item<V,D>
clone()
Literal clone.boolean
contains(V value)
boolean
contains(V value, @NotNull EquivalenceStrategy strategy)
boolean
contains(V value, EquivalenceStrategy strategy, Comparator<V> comparator)
boolean
containsEquivalentValue(V value)
boolean
containsEquivalentValue(V value, @Nullable Comparator<V> comparator)
protected void
copyValues(CloneStrategy strategy, ItemImpl clone)
Item<V,D>
createImmutableClone()
String
debugDump(int indent)
ItemDelta<V,D>
diff(Item<V,D> other, @NotNull ParameterizedEquivalenceStrategy strategy)
Computes a difference (delta) with the specified item using given equivalence strategy.boolean
equals(Object obj)
Compares this item to the specified object under NOT_LITERAL strategy (if no other is pre-set).boolean
equals(Object obj, @NotNull EquivalenceStrategy strategy)
Compares this item to the specified object under given strategy.boolean
equals(Object obj, @NotNull ParameterizedEquivalenceStrategy parameterizedEquivalenceStrategy)
Compares this item to the specified object under given strategy.void
filterValues(Function<V,Boolean> function)
V
findValue(V value, @NotNull EquivalenceStrategy strategy)
protected ItemDelta<V,D>
fixupDelta(ItemDelta<V,D> delta, Item<V,D> other)
@NotNull Collection<PrismValue>
getAllValues(ItemPath path)
Collection<V>
getClonedValues()
protected String
getDebugDumpClassName()
Return a human readable name of this class suitable for logs.D
getDefinition()
Returns applicable definition.ItemName
getElementName()
Returns the name of the item.protected @NotNull EquivalenceStrategy
getEqualsHashCodeStrategy()
Long
getHighestId()
PrismContainerValue<?>
getParent()
Returns the parent of this item (if exists).@NotNull ItemPath
getPath()
Returns the path of this item (sequence of names from the "root" container or similar object to this item).protected Object
getPathComponent()
PrismContext
getPrismContext()
PrismContext
getPrismContextLocal()
@Nullable Object
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.<X> X
getRealValue(Class<X> type)
Type override, also for compatibility.<X> X[]
getRealValuesArray(Class<X> type)
Type override, also for compatibility.@NotNull Map<String,Object>
getUserData()
Returns the "user data", a map that allows attaching arbitrary named data to this item.<T> T
getUserData(String key)
Returns the user data for the given key (name).V
getValue()
Returns the value, if there is only one.@NotNull List<V>
getValues()
Returns the values for this item.int
hashCode()
Computes hash code to be used under NOT_LITERAL equivalence strategy.int
hashCode(@NotNull EquivalenceStrategy equivalenceStrategy)
Computes hash code to be used under given equivalence strategy.int
hashCode(@NotNull ParameterizedEquivalenceStrategy equivalenceStrategy)
Computes hash code to be used under given equivalence strategy.boolean
hasRaw()
Returns true is at least one of the values is raw.boolean
isIncomplete()
Flag that indicates incomplete item.boolean
isRaw()
Returns true is all the values are raw.boolean
isSingleValue()
Returns true if the item contains 0 or 1 values and (by definition) is not multivalued.void
merge(Item<V,D> otherItem)
Merge all the values of other item to this item.void
normalize()
void
performFreeze()
protected void
propagateDeepCloneDefinition(boolean ultraDeep, D clonedDefinition, Consumer<ItemDefinition> postCloneAction)
void
recomputeAllValues()
Re-apply PolyString (and possible other) normalizations to the object.V
remove(int index)
boolean
remove(V newValue)
Removes given value from the item.boolean
remove(V value, @NotNull 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.boolean
removeAll(Collection<V> newValues)
Removes all given values from the item.void
replace(V newValue)
Replaces all values of the item by given value.void
replaceAll(Collection<V> newValues, EquivalenceStrategy strategy)
Replaces all values of the item by given values.void
revive(PrismContext prismContext)
void
setDefinition(D definition)
Sets applicable property definition.void
setElementName(QName elementName)
Sets the name of the item.void
setIncomplete(boolean incomplete)
Flags the item as incomplete.void
setParent(PrismContainerValue<?> parentValue)
Sets the parent of this item.void
setPrismContext(PrismContext prismContext)
void
setUserData(String key, Object value)
Sets the user data for the given key (name).int
size()
Returns the number of values for this item.String
toString()
boolean
valuesEqual(Collection<V> matchValues, Comparator<V> comparator)
-
Methods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, 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
add, cloneComplex, createDelta, createDelta, diff, find, findPartial, getAnyValue, getAnyValue, getDisplayName, getHelp, getRealValues, getRealValuesOrRawTypes, hasCompleteDefinition, hasNoValues, isEmpty, isOperational
-
-
-
-
Field Detail
-
elementName
protected ItemName elementName
-
parent
protected PrismContainerValue<?> parent
-
definition
protected D extends ItemDefinition definition
-
values
@NotNull protected final @NotNull List<V extends PrismValue> values
-
defaultEquivalenceStrategy
protected EquivalenceStrategy defaultEquivalenceStrategy
-
immutable
protected boolean immutable
-
incomplete
protected boolean incomplete
-
prismContext
protected transient PrismContext prismContext
-
-
Method Detail
-
getDefinition
public D getDefinition()
Description copied from interface:Item
Returns applicable definition.May return null if no definition is applicable or the definition is not known.
- Specified by:
getDefinition
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Specified by:
getDefinition
in interfaceItemable
- Returns:
- applicable definition
-
getElementName
public ItemName getElementName()
Description copied from interface:Item
Returns 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:
getElementName
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Specified by:
getElementName
in interfaceItemable
- Returns:
- item name TODO consider making element name obligatory
-
setElementName
public void setElementName(QName elementName)
Description copied from interface:Item
Sets 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:
setElementName
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Parameters:
elementName
- the name to set TODO consider removing this method
-
setDefinition
public void setDefinition(D definition)
Sets applicable property definition.- Specified by:
setDefinition
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Parameters:
definition
- the definition to set
-
isIncomplete
public boolean isIncomplete()
Description copied from interface:Item
Flag 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:
isIncomplete
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
setIncomplete
public void setIncomplete(boolean incomplete)
Description copied from interface:Item
Flags the item as incomplete.- Specified by:
setIncomplete
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Parameters:
incomplete
- The new value- See Also:
FIXME: Should be package-visible to implementation
-
getPrismContext
public PrismContext getPrismContext()
- Specified by:
getPrismContext
in interfacePrismContextSensitive
-
getPrismContextLocal
public PrismContext getPrismContextLocal()
- Specified by:
getPrismContextLocal
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
setPrismContext
public void setPrismContext(PrismContext prismContext)
- Specified by:
setPrismContext
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
getParent
public PrismContainerValue<?> getParent()
Description copied from interface:Item
Returns the parent of this item (if exists). Currently this has to be a PrismContainerValue.- Specified by:
getParent
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Returns:
- The parent if exists
-
setParent
public void setParent(PrismContainerValue<?> parentValue)
Description copied from interface:Item
Sets the parent of this item.- Specified by:
setParent
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Parameters:
parentValue
- The new parent
-
getPathComponent
protected Object getPathComponent()
-
getRealValue
@Nullable public @Nullable Object 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<V extends PrismValue,D extends ItemDefinition>
-
getRealValue
public <X> X getRealValue(Class<X> type)
Type override, also for compatibility.- Specified by:
getRealValue
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
getRealValuesArray
public <X> X[] getRealValuesArray(Class<X> type)
Type override, also for compatibility.- Specified by:
getRealValuesArray
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
getPath
@NotNull public @NotNull ItemPath getPath()
Description copied from interface:Item
Returns 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:
getPath
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Specified by:
getPath
in interfaceItemable
- Returns:
- the path
-
acceptParentVisitor
public void acceptParentVisitor(@NotNull @NotNull Visitor visitor)
Description copied from interface:Item
Accepts a visitor that visits each item/value on the way to the structure root.- Specified by:
acceptParentVisitor
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Specified by:
acceptParentVisitor
in interfaceParentVisitable
-
getUserData
@NotNull public @NotNull Map<String,Object> getUserData()
Description copied from interface:Item
Returns the "user data", a map that allows attaching arbitrary named data to this item.- Specified by:
getUserData
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Returns:
- the user data map
-
getUserData
public <T> T getUserData(String key)
Description copied from interface:Item
Returns the user data for the given key (name).- Specified by:
getUserData
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
setUserData
public void setUserData(String key, Object value)
Description copied from interface:Item
Sets the user data for the given key (name).- Specified by:
setUserData
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
getValues
@NotNull public @NotNull List<V> getValues()
Description copied from interface:Item
Returns 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:
getValues
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
getValue
public V 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<V extends PrismValue,D extends ItemDefinition>
-
isSingleValue
public boolean isSingleValue()
Description copied from interface:Item
Returns true if the item contains 0 or 1 values and (by definition) is not multivalued.- Specified by:
isSingleValue
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
findValue
public V findValue(V value, @NotNull @NotNull EquivalenceStrategy strategy)
- Specified by:
findValue
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Returns:
- a value of this item that is equivalent to the given one under given equivalence strategy (or null if no such value exists)
-
getClonedValues
public Collection<V> getClonedValues()
- Specified by:
getClonedValues
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
contains
public boolean contains(V value)
- Specified by:
contains
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- 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.
-
containsEquivalentValue
public boolean containsEquivalentValue(V value)
- Specified by:
containsEquivalentValue
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Returns:
- true if the item contains an equivalent value (the same as
Item.containsEquivalentValue(PrismValue, Comparator)
with comparator being null)
-
containsEquivalentValue
public boolean containsEquivalentValue(V value, @Nullable @Nullable Comparator<V> comparator)
- Specified by:
containsEquivalentValue
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- 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
-
contains
public boolean contains(V value, @NotNull @NotNull EquivalenceStrategy strategy)
- Specified by:
contains
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- 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(V value, EquivalenceStrategy strategy, Comparator<V> comparator)
- Specified by:
contains
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- 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.
-
valuesEqual
public boolean valuesEqual(Collection<V> matchValues, Comparator<V> comparator)
- Specified by:
valuesEqual
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- 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.
-
size
public int size()
Description copied from interface:Item
Returns the number of values for this item.- Specified by:
size
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
addAll
public boolean addAll(Collection<V> newValues) throws SchemaException
Description copied from interface:Item
Adds given values, with the same semantics as repeated add(..) calls.- Specified by:
addAll
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- 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<V> newValues, EquivalenceStrategy strategy) throws SchemaException
Description copied from interface:Item
Adds given values, with the same semantics as repeated add(..) calls. For equality testing uses given strategy.- Specified by:
addAll
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- 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<V> newValues, boolean checkUniqueness, EquivalenceStrategy strategy) throws SchemaException
Description copied from interface:Item
Adds given values, with the same semantics as repeated add(..) calls. For equality testing uses given strategy.- Specified by:
addAll
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Returns:
- true if this item changed as a result of the call (i.e. if at least one value was really added)
- Throws:
SchemaException
-
add
public boolean add(@NotNull V newValue, @NotNull @NotNull EquivalenceStrategy equivalenceStrategy) throws SchemaException
Description copied from interface:Item
Adds 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:
add
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- 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 V newValue, boolean checkUniqueness) throws SchemaException
Description copied from interface:Item
Adds a given value, unless an equivalent one is already there (if checkUniqueness is true).- Specified by:
add
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- 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 V newValue, boolean checkUniqueness, EquivalenceStrategy equivalenceStrategy) throws SchemaException
- Throws:
SchemaException
-
addForced
@Experimental public boolean addForced(@NotNull V newValue)
Adds a given value with no checks, no definition application, and so on. For internal use only.
-
removeAll
public boolean removeAll(Collection<V> newValues)
Description copied from interface:Item
Removes all given values from the item. It is basically a shortcut for repeated remove(value) call.- Specified by:
removeAll
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Returns:
- true if this item changed as a result of the call (i.e. if at least one value was really removed)
-
remove
public boolean remove(V newValue)
Description copied from interface:Item
Removes 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:
remove
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- 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(V value, @NotNull @NotNull EquivalenceStrategy strategy)
Description copied from interface:Item
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.- Specified by:
remove
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Returns:
- true if this item changed as a result of the call (i.e. if at least one value was really removed)
-
remove
public V remove(int index)
-
replaceAll
public void replaceAll(Collection<V> newValues, EquivalenceStrategy strategy) throws SchemaException
Description copied from interface:Item
Replaces all values of the item by given values.- Specified by:
replaceAll
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Throws:
SchemaException
-
replace
public void replace(V newValue) throws SchemaException
Description copied from interface:Item
Replaces all values of the item by given value.- Specified by:
replace
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Throws:
SchemaException
-
clear
public void clear()
Description copied from interface:Item
Removes all values from the item.- Specified by:
clear
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
normalize
public void normalize()
- Specified by:
normalize
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
merge
public void merge(Item<V,D> otherItem) throws SchemaException
Merge all the values of other item to this item.- Specified by:
merge
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Throws:
SchemaException
-
diff
public ItemDelta<V,D> diff(Item<V,D> other, @NotNull @NotNull ParameterizedEquivalenceStrategy strategy)
Description copied from interface:Item
Computes 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:
diff
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
accept
public void accept(Visitor visitor)
- Specified by:
accept
in interfaceVisitable<V extends PrismValue>
-
accept
public void accept(Visitor visitor, ItemPath path, boolean recursive)
- Specified by:
accept
in interfacePathVisitable
-
recomputeAllValues
public void recomputeAllValues()
Re-apply PolyString (and possible other) normalizations to the object.- Specified by:
recomputeAllValues
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
filterValues
public void filterValues(Function<V,Boolean> function)
- Specified by:
filterValues
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
applyDefinition
public void applyDefinition(D definition) throws SchemaException
- Specified by:
applyDefinition
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Throws:
SchemaException
-
applyDefinition
public void applyDefinition(D definition, boolean force) throws SchemaException
- Specified by:
applyDefinition
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Throws:
SchemaException
-
revive
public void revive(PrismContext prismContext) throws SchemaException
- Specified by:
revive
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Specified by:
revive
in interfaceRevivable
- Throws:
SchemaException
-
copyValues
protected void copyValues(CloneStrategy strategy, ItemImpl clone)
-
propagateDeepCloneDefinition
protected void propagateDeepCloneDefinition(boolean ultraDeep, D clonedDefinition, Consumer<ItemDefinition> postCloneAction)
-
checkConsistence
public void checkConsistence(boolean requireDefinitions, ConsistencyCheckScope scope)
- Specified by:
checkConsistence
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
checkConsistence
public void checkConsistence(boolean requireDefinitions, boolean prohibitRaw)
- Specified by:
checkConsistence
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
checkConsistence
public void checkConsistence(boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
- Specified by:
checkConsistence
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
checkConsistence
public void checkConsistence()
- Specified by:
checkConsistence
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
checkConsistence
public void checkConsistence(ConsistencyCheckScope scope)
- Specified by:
checkConsistence
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
checkConsistenceInternal
public void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
- Specified by:
checkConsistenceInternal
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
checkDefinition
protected abstract void checkDefinition(D def)
-
assertDefinitions
public void assertDefinitions() throws SchemaException
- Specified by:
assertDefinitions
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Throws:
SchemaException
-
assertDefinitions
public void assertDefinitions(String sourceDescription) throws SchemaException
- Specified by:
assertDefinitions
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Throws:
SchemaException
-
assertDefinitions
public void assertDefinitions(boolean tolarateRawValues, String sourceDescription) throws SchemaException
- Specified by:
assertDefinitions
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Throws:
SchemaException
-
isRaw
public boolean isRaw()
Returns true is all the values are raw.- Specified by:
isRaw
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
hasRaw
public boolean hasRaw()
Returns true is at least one of the values is raw.- Specified by:
hasRaw
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
hashCode
public int hashCode(@NotNull @NotNull EquivalenceStrategy equivalenceStrategy)
Description copied from interface:Item
Computes hash code to be used under given equivalence strategy.- Specified by:
hashCode
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
hashCode
public int hashCode(@NotNull @NotNull ParameterizedEquivalenceStrategy equivalenceStrategy)
Description copied from interface:Item
Computes hash code to be used under given equivalence strategy.- Specified by:
hashCode
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
hashCode
public int hashCode()
Description copied from interface:Item
Computes hash code to be used under NOT_LITERAL equivalence strategy.- Specified by:
hashCode
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Overrides:
hashCode
in classObject
-
getEqualsHashCodeStrategy
@NotNull protected @NotNull EquivalenceStrategy getEqualsHashCodeStrategy()
-
equals
public boolean equals(Object obj, @NotNull @NotNull EquivalenceStrategy strategy)
Description copied from interface:Item
Compares this item to the specified object under given strategy.- Specified by:
equals
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
equals
public boolean equals(Object obj, @NotNull @NotNull ParameterizedEquivalenceStrategy parameterizedEquivalenceStrategy)
Description copied from interface:Item
Compares this item to the specified object under given strategy.- Specified by:
equals
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
equals
public boolean equals(Object obj)
Description copied from interface:Item
Compares this item to the specified object under NOT_LITERAL strategy (if no other is pre-set).- Specified by:
equals
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Overrides:
equals
in classObject
-
debugDump
public String debugDump(int indent)
- Specified by:
debugDump
in interfaceDebugDumpable
-
getDebugDumpClassName
protected String getDebugDumpClassName()
Return a human readable name of this class suitable for logs.
-
appendDebugDumpSuffix
protected void appendDebugDumpSuffix(StringBuilder sb)
-
performFreeze
public void performFreeze()
- Overrides:
performFreeze
in classAbstractFreezable
-
getAllValues
@NotNull public @NotNull Collection<PrismValue> getAllValues(ItemPath path)
- Specified by:
getAllValues
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
clone
public abstract Item<V,D> clone()
Description copied from interface:Item
Literal clone.- Specified by:
clone
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
- Overrides:
clone
in classObject
-
createImmutableClone
public Item<V,D> createImmutableClone()
- Specified by:
createImmutableClone
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
getHighestId
public Long getHighestId()
- Specified by:
getHighestId
in interfaceItem<V extends PrismValue,D extends ItemDefinition>
-
-