Class DummyItem<V extends PrismValue,D extends ItemDefinition<?>,R extends Item<V,D>>   
java.lang.Object
com.evolveum.midpoint.prism.impl.item.DummyItem<V,D,R>  
- All Implemented Interfaces:
- Freezable,- Item<V,,- D> - Itemable,- ParentVisitable,- PathVisitable,- PrismContextSensitive,- Revivable,- Visitable,- DebugDumpable,- Serializable
- Direct Known Subclasses:
- DummyContainerImpl,- DummyPropertyImpl,- DummyReferenceImpl
public abstract class DummyItem<V extends PrismValue,D extends ItemDefinition<?>,R extends Item<V,D>>   
extends Object
implements Item<V,D> 
- Author:
- semancik
- See Also:
- 
Field SummaryFields inherited from interface com.evolveum.midpoint.util.DebugDumpableINDENT_STRING
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal voidfinal voidfinal voidacceptParentVisitor(@NotNull Visitor visitor) Accepts a visitor that visits each item/value on the way to the structure root.final booleanadd(V newValue, @NotNull EquivalenceStrategy equivalenceStrategy) Adds a value, overwriting existing one(s).final booleanaddAll(Collection<V> newValues, @NotNull EquivalenceStrategy strategy) Adds given values, with the same semantics as repeated add(..) calls.voidaddRespectingMetadataAndCloning(V value, @NotNull EquivalenceStrategy strategy, EquivalenceStrategy metadataEquivalenceStrategy) Adds a value, respecting the metadata.final voidapplyDefinition(D definition) final voidapplyDefinition(D definition, boolean force) final voidfinal voidassertDefinitions(boolean tolerateRaw, Supplier<String> sourceDescriptionSupplier) final voidassertDefinitions(Supplier<String> sourceDescriptionSupplier) final voidfinal voidcheckConsistence(boolean requireDefinitions, boolean prohibitRaw) final voidcheckConsistence(boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope) final voidcheckConsistence(boolean requireDefinitions, ConsistencyCheckScope scope) final voidfinal voidcheckConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope) final voidclear()Removes all values from the item.abstract Rclone()Literal clone.final StringdebugDump(int indent) protected final Rdelegate()diff(Item<V, D> other, @NotNull ParameterizedEquivalenceStrategy strategy) Computes a difference (delta) with the specified item using given equivalence strategy.final booleanCompares this item to the specified object under DEFAULT_FOR_EQUALS (DATA) strategy.final booleanequals(Object obj, @NotNull EquivalenceStrategy equivalenceStrategy) Compares this item to the specified object under given strategy.final booleanequals(Object obj, @NotNull ParameterizedEquivalenceStrategy equivalenceStrategy) Compares this item to the specified object under given strategy.final ObjectReturns object (Item or PrismValue) pointed to by the given path.final voidfreeze()@NotNull Collection<Item<?,?>> getAllItems(@NotNull ItemPath path) Returns all items corresponding to the provided path.final @NotNull Collection<PrismValue>getAllValues(ItemPath path) Returns all values corresponding to the provided path.final DReturns applicable definition.final StringReturns a display name for the item.final ItemNameReturns the name of the item.final Longfinal PrismContainerValue<?>Returns the parent of this item (if exists).final @NotNull ItemPathgetPath()Returns the path of this item (sequence of names from the "root" container or similar object to this item).final PrismContextfinal PrismContextReturns the "user data", a map that allows attaching arbitrary named data to this item.final <T> TgetUserData(String key) Returns the user data for the given key (name).Returns the values for this item.final booleanReturns true if this item and all contained items have definitions.final inthashCode()Computes hash code to be used under DEFAULT_FOR_EQUALS (currently DATA) equivalence strategy.final inthashCode(@NotNull EquivalenceStrategy equivalenceStrategy) Computes hash code to be used under given equivalence strategy.final inthashCode(@NotNull ParameterizedEquivalenceStrategy equivalenceStrategy) Computes hash code to be used under given equivalence strategy.final booleanisEmpty()Normally the same asItem.hasNoValues().final booleanfinal booleanFlag that indicates incomplete item.final voidMerge all the values of other item to this item.final voidCurrently doing nothing.final voidRe-apply PolyString (and possible other) normalizations to the object.final booleanremove(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.final booleanremoveAll(Collection<V> values, @NotNull EquivalenceStrategy strategy) Removes all given values from the item.voidremoveRespectingMetadata(V value, @NotNull EquivalenceStrategy strategy, EquivalenceStrategy metadataEquivalenceStrategy) 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.final voidReplaces all values of the item by given value.final voidreplaceAll(Collection<V> newValues, @NotNull EquivalenceStrategy strategy) Replaces all values of the item by given values.final voidrevive(PrismContext prismContext) TODO: Is revive necessary if prism context is static? TODO document (if it's found to be necessary)final voidsetDefinition(D definition) Sets applicable item definition.final voidsetElementName(QName elementName) Sets the name of the item.final voidsetIncomplete(boolean incomplete) Flags the item as incomplete.final voidsetParent(PrismContainerValue<?> parentValue) Sets the parent of this item.final voidsetPrismContext(PrismContext prismContext) final voidsetUserData(String key, Object value) Sets the user data for the given key (name).final StringtoString()Methods inherited from class java.lang.Objectfinalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.util.DebugDumpabledebugDump, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.prism.FreezablecheckImmutable, checkMutableMethods inherited from interface com.evolveum.midpoint.prism.Itemadd, addAll, addIgnoringEquivalents, cloneComplex, contains, contains, copy, createDelta, createDelta, createImmutableClone, diff, filterValues, filterYields, findPartial, findValue, findValue, getAnyValue, getAnyValue, getClonedValues, getHelp, getRealValue, getRealValue, getRealValues, getRealValuesArray, getRealValuesOrRawTypes, getValue, hasAnyValue, hasNoValues, hasRaw, isOperational, isRaw, isSingleValue, isSingleValueByDefinition, remove, removeIf, size, valuesStream
- 
Constructor Details- 
DummyItem
 
- 
- 
Method Details- 
delegate
- 
cloneDescription copied from interface:ItemLiteral clone.- Specified by:
- clonein interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Overrides:
- clonein class- Object
 
- 
accept- Specified by:
- acceptin interface- Visitable<V extends PrismValue>
 
- 
hasCompleteDefinitionpublic final boolean hasCompleteDefinition()Description copied from interface:ItemReturns true if this item and all contained items have definitions.- Specified by:
- hasCompleteDefinitionin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
getElementNameDescription 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 interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Specified by:
- getElementNamein interface- Itemable
- Returns:
- item name TODO consider making element name obligatory
 
- 
setElementNameDescription 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 interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Parameters:
- elementName- the name to set TODO consider removing this method
 
- 
getDisplayNameDescription 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 interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Returns:
- display name for the item
 
- 
isIncompletepublic final 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 interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
setIncompletepublic final void setIncomplete(boolean incomplete) Description copied from interface:ItemFlags the item as incomplete.- Specified by:
- setIncompletein interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Parameters:
- incomplete- The new value
- See Also:
 
- 
getParentDescription copied from interface:ItemReturns the parent of this item (if exists). Currently this has to be a PrismContainerValue.- Specified by:
- getParentin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Returns:
- The parent if exists
 
- 
findDescription copied from interface:ItemReturns object (Item or PrismValue) pointed to by the given path.- Specified by:
- findin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
setParentDescription copied from interface:ItemSets the parent of this item.- Specified by:
- setParentin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Parameters:
- parentValue- The new parent
 
- 
getPathDescription 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 interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Specified by:
- getPathin interface- Itemable
- Returns:
- the path
 
- 
getUserDataDescription copied from interface:ItemReturns the "user data", a map that allows attaching arbitrary named data to this item.- Specified by:
- getUserDatain interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Returns:
- the user data map
 
- 
getUserDataDescription copied from interface:ItemReturns the user data for the given key (name).- Specified by:
- getUserDatain interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
setUserDataDescription copied from interface:ItemSets the user data for the given key (name).- Specified by:
- setUserDatain interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
getValuesDescription 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 interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
getDefinitionDescription copied from interface:ItemReturns applicable definition.May return null if no definition is applicable or the definition is not known. - Specified by:
- getDefinitionin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Specified by:
- getDefinitionin interface- Itemable
- Returns:
- applicable definition
 
- 
setDefinitionDescription copied from interface:ItemSets applicable item definition.- Specified by:
- setDefinitionin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Parameters:
- definition- the definition to set TODO consider removing this method
 
- 
applyDefinition- Specified by:
- applyDefinitionin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Throws:
- SchemaException
 
- 
isEmptypublic final boolean isEmpty()Description copied from interface:ItemNormally the same asItem.hasNoValues(). But a container is considered empty also if all its values (PCVs) are empty. This is a bit strange and should be revisited.- Specified by:
- isEmptyin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
checkConsistenceInternalpublic final void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope) - Specified by:
- checkConsistenceInternalin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
assertDefinitionspublic final void assertDefinitions(boolean tolerateRaw, Supplier<String> sourceDescriptionSupplier) throws SchemaException - Specified by:
- assertDefinitionsin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Throws:
- SchemaException
 
- 
addpublic final boolean add(@NotNull V newValue, @NotNull @NotNull EquivalenceStrategy equivalenceStrategy) throws SchemaException Description copied from interface:ItemAdds a value, overwriting existing one(s). Uses specified equivalence strategy.- Specified by:
- addin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Returns:
- true if this item changed as a result of the call. This is either during real value addition or during overwriting existing value with a different one. The "difference" is taken using the DEFAULT_FOR_EQUALS (DATA) equivalence strategy.
- Throws:
- SchemaException
 
- 
accept- Specified by:
- acceptin interface- PathVisitable
 
- 
toString
- 
addAllpublic final boolean addAll(Collection<V> newValues, @NotNull @NotNull EquivalenceStrategy strategy) throws SchemaException Description copied from interface:ItemAdds given values, with the same semantics as repeated add(..) calls. For equality testing uses given strategy.- Specified by:
- addAllin interface- Item<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
 
- 
debugDump- Specified by:
- debugDumpin interface- DebugDumpable
 
- 
addRespectingMetadataAndCloningpublic void addRespectingMetadataAndCloning(V value, @NotNull @NotNull EquivalenceStrategy strategy, EquivalenceStrategy metadataEquivalenceStrategy) throws SchemaException Description copied from interface:ItemAdds a value, respecting the metadata. I.e. if equivalent value exists, the metadata are merged. (Replacing metadata of colliding provenance, adding all the others.) If a value is to be added as a whole, it is cloned.- Specified by:
- addRespectingMetadataAndCloningin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Throws:
- SchemaException
 
- 
removeRespectingMetadatapublic void removeRespectingMetadata(V value, @NotNull @NotNull EquivalenceStrategy strategy, EquivalenceStrategy metadataEquivalenceStrategy) 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. Respects metadata, i.e. if value to be removed has metadata specified, this method removes only particular metadata. Only if this means that all metadata are gone, then the value is deleted.- Specified by:
- removeRespectingMetadatain interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
removeDescription 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 interface- Item<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)
 
- 
removeAllpublic final boolean removeAll(Collection<V> values, @NotNull @NotNull EquivalenceStrategy strategy) Description copied from interface:ItemRemoves all given values from the item. It is basically a shortcut for repeatedItem.remove(PrismValue, EquivalenceStrategy)call.- Specified by:
- removeAllin interface- Item<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)
 
- 
clearpublic final void clear()Description copied from interface:ItemRemoves all values from the item.- Specified by:
- clearin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
replaceAllpublic final void replaceAll(Collection<V> newValues, @NotNull @NotNull EquivalenceStrategy strategy) throws SchemaException Description copied from interface:ItemReplaces all values of the item by given values.- Specified by:
- replaceAllin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Throws:
- SchemaException
 
- 
replaceDescription copied from interface:ItemReplaces all values of the item by given value.- Specified by:
- replacein interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Throws:
- SchemaException
 
- 
equalsDescription copied from interface:ItemCompares this item to the specified object under DEFAULT_FOR_EQUALS (DATA) strategy.- Specified by:
- equalsin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Overrides:
- equalsin class- Object
 
- 
equalsDescription copied from interface:ItemCompares this item to the specified object under given strategy.- Specified by:
- equalsin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
equalspublic final boolean equals(Object obj, @NotNull @NotNull ParameterizedEquivalenceStrategy equivalenceStrategy) Description copied from interface:ItemCompares this item to the specified object under given strategy.- Specified by:
- equalsin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
hashCodepublic final int hashCode()Description copied from interface:ItemComputes hash code to be used under DEFAULT_FOR_EQUALS (currently DATA) equivalence strategy.- Specified by:
- hashCodein interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Overrides:
- hashCodein class- Object
 
- 
hashCodeDescription copied from interface:ItemComputes hash code to be used under given equivalence strategy.- Specified by:
- hashCodein interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
hashCodeDescription copied from interface:ItemComputes hash code to be used under given equivalence strategy.- Specified by:
- hashCodein interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
diffpublic final ItemDelta<V,D> diff(Item<V, D> other, @NotNull @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 interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
normalizepublic final void normalize()Description copied from interface:ItemCurrently doing nothing.- Specified by:
- normalizein interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
mergeDescription copied from interface:ItemMerge all the values of other item to this item.- Specified by:
- mergein interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Throws:
- SchemaException
 
- 
acceptParentVisitorDescription copied from interface:ItemAccepts a visitor that visits each item/value on the way to the structure root.- Specified by:
- acceptParentVisitorin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Specified by:
- acceptParentVisitorin interface- ParentVisitable
 
- 
recomputeAllValuespublic final void recomputeAllValues()Description copied from interface:ItemRe-apply PolyString (and possible other) normalizations to the object.- Specified by:
- recomputeAllValuesin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
applyDefinition- Specified by:
- applyDefinitionin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Throws:
- SchemaException
 
- 
reviveDescription copied from interface:RevivableTODO: Is revive necessary if prism context is static? TODO document (if it's found to be necessary)
- 
checkConsistence- Specified by:
- checkConsistencein interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
checkConsistencepublic final void checkConsistence(boolean requireDefinitions, boolean prohibitRaw) - Specified by:
- checkConsistencein interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
checkConsistencepublic final void checkConsistence(boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope) - Specified by:
- checkConsistencein interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
checkConsistencepublic final void checkConsistence()- Specified by:
- checkConsistencein interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
checkConsistence- Specified by:
- checkConsistencein interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
assertDefinitions- Specified by:
- assertDefinitionsin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Throws:
- SchemaException
 
- 
assertDefinitionspublic final void assertDefinitions(Supplier<String> sourceDescriptionSupplier) throws SchemaException - Specified by:
- assertDefinitionsin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
- Throws:
- SchemaException
 
- 
isImmutablepublic final boolean isImmutable()- Specified by:
- isImmutablein interface- Freezable
 
- 
freezepublic final void freeze()
- 
getAllValuesDescription copied from interface:ItemReturns all values corresponding to the provided path. The path may contain ambiguous segments (e.g. `assignment/targetRef` when there are more assignments). Limitations: . The path can contain only name segments and the "identifier" (`#`) segment - at least for now. No ID segments. . There are no guarantees about duplicate values. They may or may not be present in the returned collections. . The caller should not modify the returned collection in any way. Note to implementors: Please take care about the performance of this method.- Specified by:
- getAllValuesin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
getAllItemsDescription copied from interface:ItemReturns all items corresponding to the provided path. This is an analogue toItem.getAllValues(ItemPath). The only difference here is that `#` segment is not allowed, as it does not correspond to an item. (Shouldn't these methods be rather called findAllValues/findAllItems?)- Specified by:
- getAllItemsin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
getPrismContext- Specified by:
- getPrismContextin interface- PrismContextSensitive
 
- 
getPrismContextLocal- Specified by:
- getPrismContextLocalin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
setPrismContext- Specified by:
- setPrismContextin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
- 
getHighestId- Specified by:
- getHighestIdin interface- Item<V extends PrismValue,- D extends ItemDefinition<?>> 
 
 
-