Interface PrismValue

All Superinterfaces:
DebugDumpable, Freezable, MidpointOriginMetadata, PathVisitable, PrismContextSensitive, Revivable, Serializable, Visitable
All Known Subinterfaces:
PrismContainerValue<C>, PrismObjectValue<O>, PrismPropertyValue<T>, PrismReferenceValue

Author:
semancik
  • Method Details

    • setPrismContext

      void setPrismContext(PrismContext prismContext)
    • getUserData

      Map<String,Object> getUserData()
    • getUserData

      Object getUserData(@NotNull @NotNull String key)
    • setUserData

      void setUserData(@NotNull @NotNull String key, Object value)
    • getParent

      Itemable getParent()
    • setParent

      void setParent(Itemable parent)
    • valueMetadata

      @Deprecated default Optional<ValueMetadata> valueMetadata()
      Deprecated.
      To be reconsidered.
    • getValueMetadata

      @Experimental @NotNull @NotNull ValueMetadata getValueMetadata()
      Maybe it is better to expect empty value metadata if these are absent. Client code would be simpler. HIGHLY EXPERIMENTAL.
    • getValueMetadataAsContainer

      @Experimental @NotNull default <C extends Containerable> @NotNull PrismContainer<C> getValueMetadataAsContainer()
      Returns value metadata as typed PrismContainer. Useful for lazy clients because of the type matching.
    • hasValueMetadata

      boolean hasValueMetadata()
      Returns:
      True if this value has any metadata (i.e. the metadata container has any value). TODO Or should we accept only non-empty values? Probably not.
    • setValueMetadata

      @Experimental void setValueMetadata(ValueMetadata valueMetadata)
      Sets metadata for this value.
    • setValueMetadata

      @Experimental void setValueMetadata(PrismContainer<?> valueMetadata)
      Sets metadata for this value.
    • setValueMetadata

      @Experimental void setValueMetadata(Containerable realValue) throws SchemaException
      Sets metadata from this value (from PCV). To be removed (most probably).
      Throws:
      SchemaException
    • getPath

      @NotNull @NotNull ItemPath getPath()
    • clearParent

      void clearParent()
      Used when we are removing the value from the previous parent. Or when we know that the previous parent will be discarded and we want to avoid unnecessary cloning.
    • applyDefinition

      void applyDefinition(ItemDefinition definition) throws SchemaException
      Throws:
      SchemaException
    • applyDefinition

      void applyDefinition(ItemDefinition definition, boolean force) throws SchemaException
      Throws:
      SchemaException
    • recompute

      void recompute()
      Recompute the value or otherwise "initialize" it before adding it to a prism tree. This may as well do nothing if no recomputing or initialization is needed.
    • recompute

      void recompute(PrismContext prismContext)
    • accept

      void accept(Visitor visitor)
      Specified by:
      accept in interface Visitable
    • accept

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

      void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
    • representsSameValue

      boolean representsSameValue(PrismValue other, boolean lax)
      Returns true if this and other value represent the same value. E.g. if they have the same IDs, OIDs or it is otherwise know that they "belong together" without a deep examination of the values.
      Parameters:
      lax - If we can reasonably assume that the two values belong together even if they don't have the same ID, e.g. if they both belong to single-valued parent items. This is useful e.g. when comparing multi-valued containers. But can cause problems when we want to be sure we are removing the correct value.
    • normalize

      void normalize()
      Currently doing nothing.
    • clone

      PrismValue clone()
      Literal clone.
    • createImmutableClone

      PrismValue createImmutableClone()
    • cloneComplex

      PrismValue cloneComplex(CloneStrategy strategy)
      Complex clone with different cloning strategies.
      See Also:
    • hashCode

      int hashCode(@NotNull @NotNull EquivalenceStrategy equivalenceStrategy)
    • hashCode

      int hashCode(@NotNull @NotNull ParameterizedEquivalenceStrategy equivalenceStrategy)
    • equals

      boolean equals(PrismValue otherValue, @NotNull @NotNull EquivalenceStrategy strategy)
    • equals

      boolean equals(PrismValue otherValue, @NotNull @NotNull ParameterizedEquivalenceStrategy strategy)
    • diff

      Collection<? extends ItemDelta> diff(PrismValue otherValue, ParameterizedEquivalenceStrategy strategy)
      Assumes matching representations. I.e. it assumes that both this and otherValue represent the same instance of item. E.g. the container with the same ID.
    • getRealClass

      @Nullable @Nullable Class<?> getRealClass()
    • hasRealClass

      @Experimental default boolean hasRealClass()
    • getRealValue

      @Nullable <T> T getRealValue()
      Returns the statically-typed "real value". TODO specify when exactly the returned value can be null. TODO decide for containers: they throw an exception if the value is not statically typed.
    • getRealValueOrRawType

      @Nullable @Experimental default @Nullable Object getRealValueOrRawType(PrismContext prismContext)
    • getRealValueIfExists

      @Nullable @Experimental default @Nullable Object getRealValueIfExists()
    • getRootValue

      @NotNull @NotNull PrismValue getRootValue()
    • getRootObjectable

      @Nullable default @Nullable Objectable getRootObjectable()
      Returns the top-most object (Objectable).
    • getNearestValueOfType

      @Nullable default <T> T getNearestValueOfType(@NotNull @NotNull Class<T> type)
    • getParentContainerValue

      PrismContainerValue<?> getParentContainerValue()
    • getTypeName

      QName getTypeName()
    • getAllValues

      @NotNull @NotNull Collection<PrismValue> getAllValues(ItemPath path)
    • getAllItems

      @NotNull @NotNull Collection<Item<?,?>> getAllItems(@NotNull @NotNull ItemPath path)
      See Item.getAllItems(ItemPath). Here the path is never empty.
    • isRaw

      boolean isRaw()
    • isEmpty

      boolean isEmpty()
    • toHumanReadableString

      String toHumanReadableString()
    • find

      Object find(ItemPath path)
    • isTransient

      @Experimental boolean isTransient()
      Returns:
      True if the value is transient, so it won't be serialized if serialization of transient value is disabled.
    • setTransient

      @Experimental void setTransient(boolean value)
    • isOfType

      @Experimental default boolean isOfType(@NotNull @NotNull QName expectedTypeName)
      Ignores untyped values (considers them non-matching). Supports non-static types. (May be slower.)
    • cloneIfImmutable

      @NotNull default @NotNull PrismValue cloneIfImmutable()
    • isObjectable

      default boolean isObjectable()
      Returns `true` if this value represents a PrismObject value. Temporary implementation that uses real value to do the check, as PrismObjectValue can mask itself as a PrismContainerValue, at least for now.