Interface ItemDelegator<V extends PrismValue,D extends ItemDefinition<?>>

All Superinterfaces:
Cloneable, ComplexCopyable<Item<V,D>>, DebugDumpable, Freezable, Item<V,D>, Itemable, ParentVisitable, PathVisitable, PrismVisitable, Revivable, Serializable, Visitable
All Known Subinterfaces:
PrismContainerDelegator<C>, PrismObjectDelegator<O>, PrismPropertyDelegator<T>, PrismReferenceDelegator
All Known Implementing Classes:
FlyweightClonedItem

public interface ItemDelegator<V extends PrismValue,D extends ItemDefinition<?>> extends Item<V,D>
  • Method Details

    • delegate

      Item<V,D> delegate()
    • getDefinition

      default 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 interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Specified by:
      getDefinition in interface Itemable
      Returns:
      applicable definition
    • hasCompleteDefinition

      default boolean hasCompleteDefinition()
      Description copied from interface: Item
      Returns true if this item and all contained items have definitions.
      Specified by:
      hasCompleteDefinition in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • getElementName

      default 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 interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Specified by:
      getElementName in interface Itemable
      Returns:
      item name TODO consider making element name obligatory
    • setElementName

      default 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 interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Parameters:
      elementName - the name to set TODO consider removing this method
    • setDefinition

      default void setDefinition(@NotNull D definition)
      Description copied from interface: Item
      Sets applicable item definition.
      Specified by:
      setDefinition in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Parameters:
      definition - the definition to set
    • getDisplayName

      default String getDisplayName()
      Description copied from interface: Item
      Returns 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:
      getDisplayName in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Returns:
      display name for the item
    • getHelp

      @Unused default String getHelp()
      Description copied from interface: Item
      Returns 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:
      getHelp in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Returns:
      help message for the item
    • isIncomplete

      default 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. *Behavior*: For single-valued items, the `incomplete` flag is cleared when a known value is set up (via delta or Java API). See also https://docs.evolveum.com/midpoint/devel/design/incomplete-items-4.9.1/.
      Specified by:
      isIncomplete in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • setIncomplete

      default void setIncomplete(boolean incomplete)
      Description copied from interface: Item
      Flags the item as incomplete. FIXME: Should be package-visible to implementation
      Specified by:
      setIncomplete in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Parameters:
      incomplete - The new value
      See Also:
    • getParent

      @Nullable default @Nullable 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 interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Returns:
      The parent if exists
    • setParent

      default void setParent(@Nullable @Nullable PrismContainerValue<?> parentValue)
      Description copied from interface: Item
      Sets the parent of this item.
      Specified by:
      setParent in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Parameters:
      parentValue - The new parent
    • getPath

      @NotNull default @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 interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Specified by:
      getPath in interface Itemable
      Returns:
      the path
    • getNamespaceContext

      @Nullable default @Nullable PrismNamespaceContext getNamespaceContext()
      Description copied from interface: Item
      Returns the namespace context for this item if available. Namespace context is currently stored in user data with key Namespace context is stored only if PrismParser.preserveNamespaceContext() is flag was used during parsing
      Specified by:
      getNamespaceContext in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Returns:
      The namespace context for this item if available.
      See Also:
    • getUserData

      @NotNull default @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 interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Returns:
      the user data map
    • getUserData

      default <T> T getUserData(String key)
      Description copied from interface: Item
      Returns the user data for the given key (name).
      Specified by:
      getUserData in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • setUserData

      default void setUserData(String key, Object value)
      Description copied from interface: Item
      Sets the user data for the given key (name).
      Specified by:
      setUserData in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • getValues

      @NotNull default @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 FIXME we should return immutable list, to avoid manipulating the values directly FIXME and maybe we should return List<? extends V> to avoid specializing the values, see ShadowAssociationValue in midPoint
      Specified by:
      getValues in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • valuesStream

      default Stream<V> valuesStream()
      Specified by:
      valuesStream in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • size

      default int size()
      Description copied from interface: Item
      Returns the number of values for this item.
      Specified by:
      size in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • getAnyValue

      default V getAnyValue()
      Description copied from interface: Item
      Returns 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:
      getAnyValue in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • getValue

      default 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 interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • getAnyValue

      default V getAnyValue(@NotNull @NotNull ValueSelector<V> selector)
      Description copied from interface: Item
      Returns a value matching given selector (or null if none exists).
      Specified by:
      getAnyValue in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • getRealValue

      @Nullable default @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 interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • getRealValue

      default <X> X getRealValue(Class<X> type)
      Description copied from interface: Item
      Type override, also for compatibility.
      Specified by:
      getRealValue in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • getRealValuesArray

      @OneUseOnly("connectorConfiguration") default <X> X[] getRealValuesArray(Class<X> type)
      Description copied from interface: Item
      Type override, also for compatibility.
      Specified by:
      getRealValuesArray in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • getRealValues

      @NotNull default @NotNull Collection<?> getRealValues()
      Description copied from interface: Item
      Returns (potentially empty) collection of "real values". The list itself is detached, freely modifiable. (Note that the values can still embed a parent, e.g., for containers and references.)
      Specified by:
      getRealValues in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      See Also:
    • getRealValues

      @NotNull default <X> @NotNull Collection<X> getRealValues(Class<X> type)
      Description copied from interface: Item
      Returns detached collection of real values, although the values are still _connected_ to the original item (in case of complex properties, references, and containers). BEWARE, it's not always possible to get the real values.
      Specified by:
      getRealValues in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • getRealValuesOrRawTypes

      @OneUseOnly("Delta serialization") @Experimental @NotNull default @NotNull Collection<Object> getRealValuesOrRawTypes()
      Specified by:
      getRealValuesOrRawTypes in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • isSingleValue

      default 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 interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • isSingleValueByDefinition

      default boolean isSingleValueByDefinition()
      Specified by:
      isSingleValueByDefinition in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • add

      default boolean add(@NotNull V newValue) throws SchemaException
      Description copied from interface: Item
      Adds a given value, overwriting existing one. It compares values using DEFAULT_FOR_EQUALS (DATA) strategy, so it e.g. takes value metadata differences into account. It is because this method is used during parsing, internal computations (typically using generated beans), and similar situations where we expect little sophistication when it comes to value comparison. The less surprises the better.
      Specified by:
      add in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Throws:
      SchemaException
    • add

      @OneUseOnly("convenience") default boolean add(@NotNull V newValue, @NotNull @NotNull EquivalenceStrategy strategy) throws SchemaException
      Description copied from interface: Item
      Adds a value, overwriting existing one(s). Uses specified equivalence strategy.
      Specified by:
      add in 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
    • addIgnoringEquivalents

      default ItemModifyResult<V> addIgnoringEquivalents(@NotNull V newValue) throws SchemaException
      Description copied from interface: Item
      Adds a value, not looking for equivalent values. (This means that the new value is always added, if possible.) Note that 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.
      Specified by:
      addIgnoringEquivalents in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Throws:
      SchemaException
    • addAll

      default 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 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
    • addAll

      default boolean addAll(Collection<V> newValues, @NotNull @NotNull 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 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
    • remove

      default boolean remove(V value)
      Description copied from interface: Item
      Removes values equivalent to given value from the item. Note we use REAL_VALUE_CONSIDER_DIFFERENT_IDS strategy that ignores value metadata and operational data. This may or may not be good! TODO reconsider
      Specified by:
      remove in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • remove

      default 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 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)
    • removeIf

      default void removeIf(Predicate<V> predicate)
      Specified by:
      removeIf in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • addRespectingMetadataAndCloning

      default ItemModifyResult<V> addRespectingMetadataAndCloning(V value, @NotNull @NotNull EquivalenceStrategy strategy, EquivalenceStrategy metadataEquivalenceStrategy) throws SchemaException
      Description copied from interface: Item
      Adds 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:
      addRespectingMetadataAndCloning in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Throws:
      SchemaException
    • removeRespectingMetadata

      default ItemModifyResult<V> removeRespectingMetadata(V value, @NotNull @NotNull EquivalenceStrategy strategy, EquivalenceStrategy metadataEquivalenceStrategy)
      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. 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:
      removeRespectingMetadata in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Returns:
      null if value was removed, otherwise value which was modified.
    • removeAll

      default boolean removeAll(Collection<V> values, @NotNull @NotNull EquivalenceStrategy strategy)
      Description copied from interface: Item
      Removes all given values from the item. It is basically a shortcut for repeated Item.remove(PrismValue, EquivalenceStrategy) call.
      Specified by:
      removeAll in 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)
    • clear

      default void clear()
      Description copied from interface: Item
      Removes all values from the item.
      Specified by:
      clear in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • replaceAll

      default void replaceAll(Collection<V> newValues, @NotNull @NotNull EquivalenceStrategy strategy) throws SchemaException
      Description copied from interface: Item
      Replaces all values of the item by given values.
      Specified by:
      replaceAll in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Throws:
      SchemaException
    • replace

      default void replace(V newValue) throws SchemaException
      Description copied from interface: Item
      Replaces all values of the item by given value.
      Specified by:
      replace in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Throws:
      SchemaException
    • equals

      default boolean equals(Object obj, @NotNull @NotNull EquivalenceStrategy equivalenceStrategy)
      Description copied from interface: Item
      Compares this item to the specified object under given strategy.
      Specified by:
      equals in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • equals

      default boolean equals(Object obj, @NotNull @NotNull ParameterizedEquivalenceStrategy equivalenceStrategy)
      Description copied from interface: Item
      Compares this item to the specified object under given strategy.
      Specified by:
      equals in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • hashCode

      default 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 interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • hashCode

      default 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 interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • contains

      default boolean contains(@NotNull V value)
      Specified by:
      contains in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Returns:
      true if the item contains a given value (by default using DEFAULT_FOR_EQUALS i.e. DATA strategy) Note that the "sameness" (ID-only value matching) is NOT considered here.
    • contains

      default boolean contains(@NotNull V value, @NotNull @NotNull EquivalenceStrategy strategy)
      Specified by:
      contains in interface Item<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.
    • findValue

      default V findValue(@NotNull V value, @NotNull @NotNull EquivalenceStrategy strategy)
      Specified by:
      findValue in interface Item<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)
    • findValue

      default V findValue(V value, @NotNull @NotNull Comparator<V> comparator)
      Specified by:
      findValue in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Returns:
      a value of this item that is equivalent to the given one under given comparator (or null if no such value exists)
    • diff

      default ItemDelta<V,D> diff(Item<V,D> other)
      Description copied from interface: Item
      Computes a difference (delta) with the specified item using DEFAULT_FOR_DELTA_APPLICATION (REAL_VALUE_CONSIDER_DIFFERENT_IDS) equivalence strategy. Compares item values only -- does NOT dive into lower levels.
      Specified by:
      diff in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • diff

      default 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 interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • getClonedValues

      default Collection<V> getClonedValues()
      Specified by:
      getClonedValues in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • normalize

      default void normalize()
      Description copied from interface: Item
      Currently doing nothing.
      Specified by:
      normalize in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • merge

      default void merge(Item<V,D> otherItem) throws SchemaException
      Description copied from interface: Item
      Merge all the values of other item to this item.
      Specified by:
      merge in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Throws:
      SchemaException
    • find

      default Object find(ItemPath path)
      Description copied from interface: Item
      Returns object (Item or PrismValue) pointed to by the given path.
      Specified by:
      find in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • findPartial

      default <IV extends PrismValue, ID extends ItemDefinition<?>> PartiallyResolvedItem<IV,ID> findPartial(ItemPath path)
      Specified by:
      findPartial in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • createDelta

      default ItemDelta<V,D> createDelta()
      Description copied from interface: Item
      Creates specific subclass of ItemDelta appropriate for type of item that this definition represents (e.g. PropertyDelta, ContainerDelta, ...)
      Specified by:
      createDelta in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • createDelta

      default ItemDelta<V,D> createDelta(ItemPath path)
      Specified by:
      createDelta in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • acceptParentVisitor

      default 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 interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Specified by:
      acceptParentVisitor in interface ParentVisitable
    • recomputeAllValues

      default void recomputeAllValues()
      Description copied from interface: Item
      Re-apply PolyString (and possible other) normalizations to the object.
      Specified by:
      recomputeAllValues in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • filterValues

      default void filterValues(Function<V,Boolean> function)
      Specified by:
      filterValues in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • filterYields

      default void filterYields(BiFunction<V,PrismContainerValue,Boolean> function)
      Specified by:
      filterYields in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • applyDefinition

      default void applyDefinition(@NotNull D definition) throws SchemaException
      Specified by:
      applyDefinition in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Throws:
      SchemaException
    • applyDefinitionIfMissing

      default void applyDefinitionIfMissing(@NotNull D definition) throws SchemaException
      Specified by:
      applyDefinitionIfMissing in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Throws:
      SchemaException
    • applyDefinition

      default void applyDefinition(@NotNull D definition, boolean force) throws SchemaException
      Description copied from interface: Item
      Applies the definition to this item (and all its values, down to the lowest level). It may even convert the values, e.g. from their raw (unparsed) form to the parsed one, or - for resource attributes - between String and PolyString values (due to the normalization).
      Specified by:
      applyDefinition in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Throws:
      SchemaException
    • createImmutableClone

      default Item<V,D> createImmutableClone()
      Specified by:
      createImmutableClone in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • cloneComplex

      @NotNull default @NotNull Item<V,D> cloneComplex(@NotNull @NotNull CloneStrategy strategy)
      Description copied from interface: Item
      Complex clone with different cloning strategies.
      Specified by:
      cloneComplex in interface ComplexCopyable<V extends PrismValue>
      Specified by:
      cloneComplex in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      See Also:
    • checkConsistence

      default void checkConsistence(boolean requireDefinitions, ConsistencyCheckScope scope)
      Specified by:
      checkConsistence in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • checkConsistence

      default void checkConsistence(boolean requireDefinitions, boolean prohibitRaw)
      Specified by:
      checkConsistence in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • checkConsistence

      default void checkConsistence(boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
      Specified by:
      checkConsistence in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • checkConsistence

      default void checkConsistence()
      Specified by:
      checkConsistence in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • checkConsistence

      default void checkConsistence(ConsistencyCheckScope scope)
      Specified by:
      checkConsistence in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • checkConsistenceInternal

      default void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
      Specified by:
      checkConsistenceInternal in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • assertDefinitions

      default void assertDefinitions() throws SchemaException
      Specified by:
      assertDefinitions in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Throws:
      SchemaException
    • assertDefinitions

      default void assertDefinitions(Supplier<String> sourceDescriptionSupplier) throws SchemaException
      Specified by:
      assertDefinitions in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Throws:
      SchemaException
    • assertDefinitions

      default void assertDefinitions(boolean tolerateRawValues, Supplier<String> sourceDescriptionSupplier) throws SchemaException
      Specified by:
      assertDefinitions in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Throws:
      SchemaException
    • isRaw

      default boolean isRaw()
      Description copied from interface: Item
      Returns true is all the values are raw.
      Specified by:
      isRaw in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • hasRaw

      default boolean hasRaw()
      Description copied from interface: Item
      Returns true is at least one of the values is raw.
      Specified by:
      hasRaw in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • isEmpty

      default boolean isEmpty()
      Description copied from interface: Item
      Normally the same as Item.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:
      isEmpty in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • hasNoValues

      default boolean hasNoValues()
      Specified by:
      hasNoValues in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • hasAnyValue

      default boolean hasAnyValue()
      Specified by:
      hasAnyValue in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • isOperational

      default boolean isOperational()
      Description copied from interface: Item
      Returns true if this item is metadata item that should be ignored for metadata-insensitive comparisons and hashCode functions.
      Specified by:
      isOperational in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • getAllValues

      @NotNull default @NotNull Collection<PrismValue> getAllValues(ItemPath path)
      Description copied from interface: Item
      Returns 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:
      getAllValues in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • getAllItems

      @NotNull default @NotNull Collection<Item<?,?>> getAllItems(@NotNull @NotNull ItemPath path)
      Description copied from interface: Item
      Returns all items corresponding to the provided path. This is an analogue to Item.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:
      getAllItems in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • getHighestId

      default Long getHighestId()
      Specified by:
      getHighestId in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
    • acceptVisitor

      default boolean acceptVisitor(PrismVisitor visitor)
      Description copied from interface: PrismVisitable
      Accept visitor and visits prism item or value and it's children Note: name is not accept, but accept visitor to prevent naming conflict in lambdas dynamic languages such as groovy with Visitable.accept(com.evolveum.midpoint.prism.Visitor)
      Specified by:
      acceptVisitor in interface Item<V extends PrismValue,D extends ItemDefinition<?>>
      Specified by:
      acceptVisitor in interface PrismVisitable
      Returns:
      return value of PrismVisitor.visit(PrismVisitable) invocation for this visitable.
    • debugDump

      default String debugDump()
      Description copied from interface: DebugDumpable
      Show the content of the object intended for diagnostics by system administrator. The out put should be suitable to use in system logs at "debug" level. It may be multi-line, but in that case it should be well indented and quite terse. As it is intended to be used by system administrator, it should not use any developer terms such as class names, exceptions or stack traces.
      Specified by:
      debugDump in interface DebugDumpable
      Returns:
      content of the object intended for diagnostics by system administrator.
    • debugDump

      default String debugDump(int indent)
      Specified by:
      debugDump in interface DebugDumpable
    • debugDumpLazily

      default Object debugDumpLazily()
      Specified by:
      debugDumpLazily in interface DebugDumpable
    • debugDumpLazily

      default Object debugDumpLazily(int indent)
      Specified by:
      debugDumpLazily in interface DebugDumpable
    • accept

      default void accept(Visitor visitor)
      Specified by:
      accept in interface Visitable<V extends PrismValue>
    • accept

      default void accept(Visitor visitor, ItemPath path, boolean recursive)
      Specified by:
      accept in interface PathVisitable
    • revive

      default void revive(PrismContext prismContext)
      Description copied from interface: Revivable
      TODO: Is revive necessary if prism context is static? TODO document (if it's found to be necessary)
      Specified by:
      revive in interface Revivable
    • isImmutable

      default boolean isImmutable()
      Specified by:
      isImmutable in interface Freezable
    • freeze

      default void freeze()
      Description copied from interface: Freezable
      Should be no-op (or very quick) if the object is already immutable.
      Specified by:
      freeze in interface Freezable
    • checkMutable

      default void checkMutable()
      Specified by:
      checkMutable in interface Freezable
    • checkImmutable

      default void checkImmutable()
      Specified by:
      checkImmutable in interface Freezable