Package com.evolveum.midpoint.prism
Interface PrismValue
- All Superinterfaces:
- DebugDumpable,- Freezable,- MidpointOriginMetadata,- PathVisitable,- PrismVisitable,- Revivable,- SchemaLookup.Aware,- Serializable,- Visitable
- All Known Subinterfaces:
- PrismContainerValue<C>,- PrismContainerValueDelegator<C>,- PrismObjectValue<O>,- PrismPropertyValue<T>,- PrismReferenceValue
- All Known Implementing Classes:
- com.evolveum.midpoint.prism.impl.PrismContainerValueImpl,- com.evolveum.midpoint.prism.impl.PrismReferenceValueImpl,- com.evolveum.midpoint.prism.impl.PrismValueImpl,- ShadowAssociationValue,- ShadowReferenceAttributeValue
public interface PrismValue
extends PrismVisitable, Visitable, PathVisitable, Serializable, DebugDumpable, Revivable, Freezable, MidpointOriginMetadata, SchemaLookup.Aware
- Author:
- semancik
- 
Field SummaryFields inherited from interface com.evolveum.midpoint.util.DebugDumpableINDENT_STRING
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoiddefault booleanacceptVisitor(PrismVisitor visitor) 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 withVisitable.accept(com.evolveum.midpoint.prism.Visitor)default PrismValueapplyDefinition(@NotNull ItemDefinition<?> definition) Definition application MAY change the value (currently only for container values).applyDefinition(@NotNull ItemDefinition<?> definition, boolean force) Definition application MAY change the value (currently only for container values).default voidapplyDefinitionLegacy(@NotNull ItemDefinition<?> definition) This one checks that nothing has changed.default voidapplyDefinitionLegacy(@NotNull ItemDefinition<?> definition, boolean force) Definition application MAY change the value (currently only for container/reference values).voidcheckConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope) voidUsed when we are removing the value from the previous parent.clone()Literal clone.cloneComplex(@NotNull CloneStrategy strategy) Complex clone with different cloning strategies.default @NotNull PrismValuedefault voidCollection<? extends ItemDelta>diff(PrismValue otherValue, ParameterizedEquivalenceStrategy strategy) Assumes matching representations.booleanequals(PrismValue otherValue, @NotNull EquivalenceStrategy strategy) booleanequals(PrismValue otherValue, @NotNull ParameterizedEquivalenceStrategy strategy) @NotNull Collection<Item<?,?>> getAllItems(@NotNull ItemPath path) @NotNull Collection<PrismValue>getAllValues(ItemPath path) default <T> TgetNearestValueOfType(@NotNull Class<T> type) @NotNull ItemPathgetPath()@Nullable Class<?><T> TReturns the statically-typed "real value".default @Nullable Objectdefault @Nullable Objectdefault @Nullable ObjectableReturns the top-most object (Objectable).@NotNull PrismValuegetUserData(@NotNull String key) @NotNull ValueMetadataReturns the value metadata, creating empty one if there's none.default <C extends Containerable>
 @NotNull PrismContainer<C>Returns value metadata as typed PrismContainer.@Nullable ValueMetadataReturns the value metadata, if there is any.inthashCode(@NotNull EquivalenceStrategy equivalenceStrategy) inthashCode(@NotNull ParameterizedEquivalenceStrategy equivalenceStrategy) default booleanbooleanbooleanisEmpty()default booleanReturns `true` if this value represents aPrismObjectvalue.default booleanIgnores untyped values (considers them non-matching).booleanisRaw()booleanvoidCurrently doing nothing.voidRecompute the value or otherwise "initialize" it before adding it to a prism tree.voidrecompute(PrismContext prismContext) booleanrepresentsSameValue(PrismValue other, EquivalenceStrategy strategy, boolean lax) Returns true if this and other value represent the same value.default SchemaLookupvoidvoidsetTransient(boolean value) voidsetUserData(@NotNull String key, Object value) voidsetValueMetadata(Containerable realValue) Sets metadata from this value (from PCV).voidsetValueMetadata(PrismContainer<?> valueMetadata) Sets metadata for this value.voidsetValueMetadata(ValueMetadata valueMetadata) Sets metadata for this value.Methods inherited from interface com.evolveum.midpoint.util.DebugDumpabledebugDump, debugDump, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.prism.FreezablecheckImmutable, checkMutable, freeze, isImmutableMethods inherited from interface com.evolveum.midpoint.prism.metadata.MidpointOriginMetadatagetOriginObject, getOriginType, setOriginObject, setOriginType
- 
Method Details- 
getUserData
- 
getUserData
- 
setUserData
- 
getParentItemable getParent()
- 
setParent
- 
getValueMetadataReturns the value metadata, creating empty one if there's none. When performance is critical, consider usinggetValueMetadataIfExists()instead; or callhasValueMetadata()first.
- 
getValueMetadataIfExistsReturns the value metadata, if there is any.
- 
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.
- 
hasValueMetadataboolean 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.
 
- 
setValueMetadataSets metadata for this value.
- 
setValueMetadataSets metadata for this value.
- 
setValueMetadataSets metadata from this value (from PCV). To be removed (most probably).- Throws:
- SchemaException
 
- 
deleteValueMetadatadefault void deleteValueMetadata()
- 
getPath
- 
clearParentvoid 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.
- 
applyDefinitiondefault PrismValue applyDefinition(@NotNull @NotNull ItemDefinition<?> definition) throws SchemaException Definition application MAY change the value (currently only for container values). The caller must deal with that. To be seen if this is a good idea. But probably so, because there are various situations when the definition application changes the nature of a prism value (midPoint shadow associations are currently the only places) but of prism items (midPoint attributes and associations need this; and it must be worked around for now).- Throws:
- SchemaException
 
- 
applyDefinitionLegacydefault void applyDefinitionLegacy(@NotNull @NotNull ItemDefinition<?> definition) throws SchemaException This one checks that nothing has changed.- Throws:
- SchemaException
 
- 
applyDefinitionPrismValue applyDefinition(@NotNull @NotNull ItemDefinition<?> definition, boolean force) throws SchemaException Definition application MAY change the value (currently only for container values). The caller must deal with that.- Throws:
- SchemaException
 
- 
applyDefinitionLegacydefault void applyDefinitionLegacy(@NotNull @NotNull ItemDefinition<?> definition, boolean force) throws SchemaException Definition application MAY change the value (currently only for container/reference values). The caller must deal with that.- Throws:
- SchemaException
 
- 
recomputevoid 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
- 
accept
- 
accept- Specified by:
- acceptin interface- PathVisitable
 
- 
checkConsistenceInternalvoid checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope) 
- 
representsSameValueReturns 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.
 
- 
normalizevoid normalize()Currently doing nothing.
- 
clonePrismValue clone()Literal clone.
- 
createImmutableClonePrismValue createImmutableClone()
- 
cloneComplexComplex clone with different cloning strategies.- See Also:
 
- 
hashCode
- 
hashCode
- 
equals
- 
equals
- 
diffCollection<? 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
- 
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
- 
getRealValueIfExists
- 
getRootValue
- 
getRootObjectableReturns the top-most object (Objectable).
- 
getNearestValueOfType
- 
getParentContainerValuePrismContainerValue<?> getParentContainerValue()
- 
getTypeNameQName getTypeName()
- 
getAllValues
- 
getAllItemsSeeItem.getAllItems(ItemPath). Here the path is never empty.
- 
isRawboolean isRaw()
- 
isEmptyboolean isEmpty()
- 
toHumanReadableStringString toHumanReadableString()
- 
find
- 
isTransient- Returns:
- True if the value is transient, so it won't be serialized if serialization of transient value is disabled.
 
- 
setTransient
- 
isOfTypeIgnores untyped values (considers them non-matching). Supports non-static types. (May be slower.)
- 
cloneIfImmutable
- 
isObjectabledefault boolean isObjectable()Returns `true` if this value represents aPrismObjectvalue. Temporary implementation that uses real value to do the check, asPrismObjectValuecan mask itself as aPrismContainerValue, at least for now.
- 
getSchemaContextSchemaContext getSchemaContext()
- 
schemaLookup- Specified by:
- schemaLookupin interface- SchemaLookup.Aware
 
- 
acceptVisitorDescription copied from interface:PrismVisitableAccept 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 withVisitable.accept(com.evolveum.midpoint.prism.Visitor)- Specified by:
- acceptVisitorin interface- PrismVisitable
- Returns:
- return value of PrismVisitor.visit(PrismVisitable)invocation for this visitable.
 
 
-