Package com.evolveum.midpoint.prism.impl
Class PrismValueImpl
java.lang.Object
com.evolveum.midpoint.prism.AbstractFreezable
com.evolveum.midpoint.prism.impl.PrismValueImpl
- All Implemented Interfaces:
Freezable,ItemDefinitionTransformer.TransformableValue,MidpointOriginMetadata,PathVisitable,PrismContextSensitive,PrismValue,Revivable,Visitable,DebugDumpable,Serializable
- Direct Known Subclasses:
PrismContainerValueImpl,PrismPropertyValueImpl,PrismReferenceValueImpl
public abstract class PrismValueImpl
extends AbstractFreezable
implements PrismValue, ItemDefinitionTransformer.TransformableValue
- Author:
- semancik
- See Also:
-
Field Summary
FieldsFields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidprotected voidappendOriginDump(StringBuilder builder) voidapplyDefinition(ItemDefinition definition) voidapplyDefinition(ItemDefinition definition, boolean force) abstract voidcheckConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope) voidUsed when we are removing the value from the previous parent.abstract PrismValueclone()Literal clone.abstract PrismValuecloneComplex(CloneStrategy strategy) Complex clone with different cloning strategies.protected voidcopyValues(CloneStrategy strategy, PrismValueImpl clone) Collection<? extends ItemDelta>diff(PrismValue otherValue, ParameterizedEquivalenceStrategy strategy) Assumes matching representations.final voiddiffMatchingRepresentation(PrismValue otherValue, Collection<? extends ItemDelta> deltas, ParameterizedEquivalenceStrategy strategy) booleandiffMatchingRepresentation(PrismValue otherValue, Collection<? extends ItemDelta> deltas, ParameterizedEquivalenceStrategy strategy, boolean exitOnDiff) booleanequals(PrismValue otherValue, @NotNull EquivalenceStrategy equivalenceStrategy) booleanequals(PrismValue other, @NotNull ParameterizedEquivalenceStrategy strategy) boolean@NotNull Collection<Item<?,?>> getAllItems(@NotNull ItemPath path) @NotNull Collection<PrismValue>getAllValues(ItemPath path) protected ItemDefinition@NotNull ItemPathgetPath()protected Objectabstract @Nullable Class<?>abstract <T> TReturns the statically-typed "real value".@NotNull PrismValuegetUserData(@NotNull String key) @NotNull ValueMetadataMaybe it is better to expect empty value metadata if these are absent.inthashCode()inthashCode(@NotNull EquivalenceStrategy equivalenceStrategy) inthashCode(@NotNull ParameterizedEquivalenceStrategy equivalenceStrategy) booleanbooleanvoidCurrently doing nothing.protected voidvoidRecompute the value or otherwise "initialize" it before adding it to a prism tree.abstract voidrecompute(PrismContext prismContext) booleanrepresentsSameValue(PrismValue other, boolean lax) Returns true if this and other value represent the same value.voidrevive(PrismContext prismContext) TODO: Is revive necessary if prism context is static? TODO document (if it's found to be necessary)voidsetOriginObject(Objectable source) voidsetOriginType(OriginType type) voidvoidsetPrismContext(PrismContext prismContext) voidsetTransient(boolean value) voidsetUserData(@NotNull String key, Object value) voidsetValueMetadata(Containerable realValue) Sets metadata from this value (from PCV).voidsetValueMetadata(PrismContainer<?> valueMetadataContainer) Sets metadata for this value.voidsetValueMetadata(ValueMetadata valueMetadata) Sets metadata for this value.abstract StringMethods inherited from class com.evolveum.midpoint.prism.AbstractFreezable
freeze, freeze, freezeAll, freezeNullableList, isImmutable, isMutableMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDump, debugDumpLazily, debugDumpLazilyMethods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze, isImmutableMethods inherited from interface com.evolveum.midpoint.prism.ItemDefinitionTransformer.TransformableValue
transformDefinitionMethods inherited from interface com.evolveum.midpoint.prism.PrismValue
cloneIfImmutable, find, getNearestValueOfType, getRealValueIfExists, getRealValueOrRawType, getRootObjectable, getValueMetadataAsContainer, hasRealClass, isEmpty, isObjectable, isOfType, isRaw, valueMetadata
-
Field Details
-
defaultEquivalenceStrategy
-
-
Method Details
-
setPrismContext
- Specified by:
setPrismContextin interfacePrismValue
-
setOriginObject
- Specified by:
setOriginObjectin interfaceMidpointOriginMetadata
-
setOriginType
- Specified by:
setOriginTypein interfaceMidpointOriginMetadata
-
getOriginType
- Specified by:
getOriginTypein interfaceMidpointOriginMetadata
-
getOriginObject
- Specified by:
getOriginObjectin interfaceMidpointOriginMetadata
-
getUserData
- Specified by:
getUserDatain interfacePrismValue
-
getUserData
- Specified by:
getUserDatain interfacePrismValue
-
setUserData
- Specified by:
setUserDatain interfacePrismValue
-
getParent
- Specified by:
getParentin interfacePrismValue
-
setParent
- Specified by:
setParentin interfacePrismValue
-
getPath
- Specified by:
getPathin interfacePrismValue
-
getPathComponent
-
clearParent
public 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.- Specified by:
clearParentin interfacePrismValue
-
getPrismContext
- Specified by:
getPrismContextin interfacePrismContextSensitive
-
getDefinition
-
applyDefinition
- Specified by:
applyDefinitionin interfacePrismValue- Throws:
SchemaException
-
applyDefinition
- Specified by:
applyDefinitionin interfacePrismValue- Throws:
SchemaException
-
revive
Description copied from interface:RevivableTODO: Is revive necessary if prism context is static? TODO document (if it's found to be necessary) -
recompute
public 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.- Specified by:
recomputein interfacePrismValue
-
recompute
- Specified by:
recomputein interfacePrismValue
-
accept
- Specified by:
acceptin interfacePrismValue- Specified by:
acceptin interfaceVisitable
-
accept
- Specified by:
acceptin interfacePathVisitable- Specified by:
acceptin interfacePrismValue
-
checkConsistenceInternal
public abstract void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope) - Specified by:
checkConsistenceInternalin interfacePrismValue
-
representsSameValue
Description copied from interface:PrismValueReturns 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.- Specified by:
representsSameValuein interfacePrismValuelax- 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
public void normalize()Description copied from interface:PrismValueCurrently doing nothing.- Specified by:
normalizein interfacePrismValue
-
clone
Literal clone.- Specified by:
clonein interfacePrismValue- Overrides:
clonein classObject
-
createImmutableClone
- Specified by:
createImmutableClonein interfacePrismValue
-
cloneComplex
Complex clone with different cloning strategies.- Specified by:
cloneComplexin interfacePrismValue- See Also:
-
copyValues
-
hashCode
public int hashCode() -
hashCode
- Specified by:
hashCodein interfacePrismValue
-
hashCode
- Specified by:
hashCodein interfacePrismValue
-
equals
public boolean equals(PrismValue otherValue, @NotNull @NotNull EquivalenceStrategy equivalenceStrategy) - Specified by:
equalsin interfacePrismValue
-
equals
public boolean equals(PrismValue other, @NotNull @NotNull ParameterizedEquivalenceStrategy strategy) - Specified by:
equalsin interfacePrismValue
-
equals
-
diff
public 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.- Specified by:
diffin interfacePrismValue
-
diffMatchingRepresentation
public final void diffMatchingRepresentation(PrismValue otherValue, Collection<? extends ItemDelta> deltas, ParameterizedEquivalenceStrategy strategy) -
diffMatchingRepresentation
public boolean diffMatchingRepresentation(PrismValue otherValue, Collection<? extends ItemDelta> deltas, ParameterizedEquivalenceStrategy strategy, boolean exitOnDiff) -
appendOriginDump
-
toHumanReadableString
- Specified by:
toHumanReadableStringin interfacePrismValue
-
getRealClass
- Specified by:
getRealClassin interfacePrismValue
-
getRealValue
@Nullable public abstract <T> T getRealValue()Description copied from interface:PrismValueReturns 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.- Specified by:
getRealValuein interfacePrismValue
-
getRootValue
- Specified by:
getRootValuein interfacePrismValue
-
getParentContainerValue
- Specified by:
getParentContainerValuein interfacePrismValue
-
getTypeName
- Specified by:
getTypeNamein interfacePrismValue
-
getAllValues
Description copied from interface:PrismValue- Specified by:
getAllValuesin interfacePrismValue
-
getAllItems
Description copied from interface:PrismValueSeeItem.getAllItems(ItemPath). Here the path is never empty.- Specified by:
getAllItemsin interfacePrismValue
-
getValueMetadata
Description copied from interface:PrismValueMaybe it is better to expect empty value metadata if these are absent. Client code would be simpler. HIGHLY EXPERIMENTAL.- Specified by:
getValueMetadatain interfacePrismValue
-
hasValueMetadata
public boolean hasValueMetadata()- Specified by:
hasValueMetadatain interfacePrismValue- 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
Description copied from interface:PrismValueSets metadata for this value.- Specified by:
setValueMetadatain interfacePrismValue
-
setValueMetadata
Description copied from interface:PrismValueSets metadata for this value.- Specified by:
setValueMetadatain interfacePrismValue
-
setValueMetadata
Description copied from interface:PrismValueSets metadata from this value (from PCV). To be removed (most probably).- Specified by:
setValueMetadatain interfacePrismValue- Throws:
SchemaException
-
performFreeze
protected void performFreeze()- Overrides:
performFreezein classAbstractFreezable
-
isTransient
public boolean isTransient()- Specified by:
isTransientin interfacePrismValue- Returns:
- True if the value is transient, so it won't be serialized if serialization of transient value is disabled.
-
setTransient
public void setTransient(boolean value) - Specified by:
setTransientin interfacePrismValue
-