Package com.evolveum.midpoint.prism
Interface PrismObject<O extends Objectable>
-
- All Superinterfaces:
DebugDumpable
,Item<PrismContainerValue<O>,PrismContainerDefinition<O>>
,Itemable
,ParentVisitable
,PathVisitable
,PrismContainer<O>
,PrismContainerable<O>
,Revivable
,Serializable
,Visitable
- All Known Implementing Classes:
PrismObjectImpl
public interface PrismObject<O extends Objectable> extends PrismContainer<O>
Common supertype for all identity objects. Defines basic properties that each object must have to live in our system (identifier, name). Objects consists of identifier and name (see definition below) and a set of properties represented as XML elements in the object's body. The attributes are represented as first-level XML elements (tags) of the object XML representation and may be also contained in other tags (e.g. extension, attributes). The QName (namespace and local name) of the element holding the property is considered to be a property name. This class is named PrismObject instead of Object to avoid confusion with java.lang.Object.- Author:
- Radovan Semancik Class invariant: has at most one value (potentially empty). When making this object immutable and there's no value, we create one; in order to prevent exceptions on later getValue calls.
-
-
Field Summary
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description <I extends Item>
voidaddExtensionItem(I item)
void
addReplaceExisting(Item<?,?> item)
void
applyDefinition(PrismContainerDefinition<O> definition)
O
asObjectable()
static <T extends Objectable>
TasObjectable(PrismObject<T> object)
static <T extends Objectable>
List<T>asObjectableList(List<PrismObject<T>> objects)
static PrismObject<?>
asPrismObject(Objectable o)
void
checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
PrismObject<O>
clone()
Literal clone.PrismObject<O>
cloneComplex(CloneStrategy strategy)
Complex clone with different cloning strategies.PrismObject<O>
cloneIfImmutable()
ObjectDelta<O>
createAddDelta()
ObjectDelta<O>
createDeleteDelta()
ObjectDelta<O>
createDelta(ChangeType changeType)
PrismContainer<?>
createExtension()
PrismObject<O>
createImmutableClone()
ObjectDelta<O>
createModifyDelta()
PrismObjectValue<O>
createNewValue()
PrismObjectDefinition<O>
deepCloneDefinition(boolean ultraDeep, Consumer<ItemDefinition> postCloneAction)
ObjectDelta<O>
diff(PrismObject<O> other)
ObjectDelta<O>
diff(PrismObject<O> other, ParameterizedEquivalenceStrategy strategy)
boolean
equals(Object obj)
Compares this item to the specified object under NOT_LITERAL strategy (if no other is pre-set).boolean
equivalent(Object obj)
this method ignores some part of the object during comparison (e.g.<I extends Item>
IfindExtensionItem(String elementLocalName)
<I extends Item>
IfindExtensionItem(QName elementName)
String
getBusinessDisplayName()
Return display name intended for business users of midPointPrismObjectDefinition<O>
getDefinition()
Returns applicable property container definition.PrismContainer<?>
getExtension()
PrismContainerValue<?>
getExtensionContainerValue()
PolyString
getName()
String
getOid()
Returns Object ID (OID).PrismContainer<?>
getOrCreateExtension()
PrismContainerValue<?>
getParent()
Returns the parent of this item (if exists).ItemPath
getPath()
Returns the path of this item (sequence of names from the "root" container or similar object to this item).PrismObjectValue<O>
getValue()
Returns the value, if there is only one.String
getVersion()
Collection<? extends ItemDelta<?,?>>
narrowModifications(Collection<? extends ItemDelta<?,?>> modifications, boolean assumeMissingItems)
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>>
voidremoveItem(ItemPath path, Class<I> itemType)
void
setImmutable(boolean immutable)
void
setOid(String oid)
void
setParent(PrismContainerValue<?> parentValue)
Sets the parent of this item.void
setValue(PrismContainerValue<O> value)
void
setVersion(String version)
String
toDebugName()
Returns short string representing identity of this object.String
toDebugType()
Returns short string identification of object type.String
toString()
-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.prism.Item
acceptParentVisitor, add, add, add, addAll, addAll, applyDefinition, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkImmutability, clear, contains, contains, contains, containsEquivalentValue, containsEquivalentValue, diff, diff, equals, equals, filterValues, findValue, getAllValues, getAnyValue, getClonedValues, getDisplayName, getElementName, getHelp, getHighestId, getPrismContext, getPrismContextLocal, getRealValuesOrRawTypes, getUserData, getUserData, getValues, hasCompleteDefinition, hashCode, hashCode, hashCode, hasNoValues, hasRaw, isImmutable, isIncomplete, isOperational, isRaw, isSingleValue, merge, modifyUnfrozen, modifyUnfrozen, normalize, recomputeAllValues, remove, remove, removeAll, replace, replaceAll, revive, setElementName, setIncomplete, setPrismContext, setUserData, size, valuesEqual
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismContainer
accept, add, assertDefinitions, canRepresent, canRepresent, containsItem, createDelta, createDelta, debugDump, diff, diff, diffModifications, diffModifications, find, findContainer, findCreateItem, findCreateItem, findItem, findItem, findItem, findOrCreateContainer, findOrCreateItem, findOrCreateItem, findOrCreateProperty, findOrCreateReference, findPartial, findProperty, findReference, findValue, getCompileTimeClass, getPropertyRealValue, getRealValue, getRealValues, getValue, isEmpty, mergeValue, mergeValues, mergeValues, remove, removeContainer, removeProperty, removeReference, setContainerRealValue, setDefinition, setPropertyRealValue, setPropertyRealValues, trim, trimDefinitionTree
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismContainerable
getComplexTypeDefinition
-
-
-
-
Method Detail
-
createNewValue
PrismObjectValue<O> createNewValue()
- Specified by:
createNewValue
in interfacePrismContainer<O extends Objectable>
-
getValue
@NotNull PrismObjectValue<O> 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 interfaceItem<PrismContainerValue<O extends Objectable>,PrismContainerDefinition<O extends Objectable>>
- Specified by:
getValue
in interfacePrismContainer<O extends Objectable>
-
setValue
void setValue(@NotNull PrismContainerValue<O> value) throws SchemaException
- Specified by:
setValue
in interfacePrismContainer<O extends Objectable>
- Throws:
SchemaException
-
getOid
String getOid()
Returns Object ID (OID). May return null if the object does not have an OID.- Returns:
- Object ID (OID)
-
setOid
void setOid(String oid)
-
getVersion
String getVersion()
-
setVersion
void setVersion(String version)
-
getDefinition
PrismObjectDefinition<O> getDefinition()
Description copied from interface:PrismContainer
Returns applicable property container definition.May return null if no definition is applicable or the definition is not know.
- Specified by:
getDefinition
in interfaceItem<PrismContainerValue<O extends Objectable>,PrismContainerDefinition<O extends Objectable>>
- Specified by:
getDefinition
in interfaceItemable
- Specified by:
getDefinition
in interfacePrismContainer<O extends Objectable>
- Specified by:
getDefinition
in interfacePrismContainerable<O extends Objectable>
- Returns:
- applicable property container definition
-
asObjectable
@NotNull O asObjectable()
-
getName
PolyString getName()
-
getExtension
PrismContainer<?> getExtension()
-
getOrCreateExtension
PrismContainer<?> getOrCreateExtension() throws SchemaException
- Throws:
SchemaException
-
getExtensionContainerValue
PrismContainerValue<?> getExtensionContainerValue()
-
addExtensionItem
<I extends Item> void addExtensionItem(I item) throws SchemaException
- Throws:
SchemaException
-
createExtension
PrismContainer<?> createExtension() throws SchemaException
- Throws:
SchemaException
-
applyDefinition
void applyDefinition(PrismContainerDefinition<O> definition) throws SchemaException
- Specified by:
applyDefinition
in interfaceItem<PrismContainerValue<O extends Objectable>,PrismContainerDefinition<O extends Objectable>>
- Specified by:
applyDefinition
in interfacePrismContainer<O extends Objectable>
- Throws:
SchemaException
-
removeItem
<IV extends PrismValue,ID extends ItemDefinition,I extends Item<IV,ID>> void removeItem(ItemPath path, Class<I> itemType)
- Specified by:
removeItem
in interfacePrismContainer<O extends Objectable>
-
addReplaceExisting
void addReplaceExisting(Item<?,?> item) throws SchemaException
- Throws:
SchemaException
-
clone
PrismObject<O> clone()
Description copied from interface:Item
Literal clone.- Specified by:
clone
in interfaceItem<PrismContainerValue<O extends Objectable>,PrismContainerDefinition<O extends Objectable>>
- Specified by:
clone
in interfacePrismContainer<O extends Objectable>
-
cloneComplex
PrismObject<O> cloneComplex(CloneStrategy strategy)
Description copied from interface:Item
Complex clone with different cloning strategies.- Specified by:
cloneComplex
in interfaceItem<PrismContainerValue<O extends Objectable>,PrismContainerDefinition<O extends Objectable>>
- Specified by:
cloneComplex
in interfacePrismContainer<O extends Objectable>
- See Also:
CloneStrategy
-
deepCloneDefinition
PrismObjectDefinition<O> deepCloneDefinition(boolean ultraDeep, Consumer<ItemDefinition> postCloneAction)
- Specified by:
deepCloneDefinition
in interfacePrismContainer<O extends Objectable>
-
diff
@NotNull ObjectDelta<O> diff(PrismObject<O> other)
-
diff
@NotNull ObjectDelta<O> diff(PrismObject<O> other, ParameterizedEquivalenceStrategy strategy)
-
narrowModifications
Collection<? extends ItemDelta<?,?>> narrowModifications(Collection<? extends ItemDelta<?,?>> modifications, boolean assumeMissingItems)
-
createDelta
ObjectDelta<O> createDelta(ChangeType changeType)
-
createAddDelta
ObjectDelta<O> createAddDelta()
-
createModifyDelta
ObjectDelta<O> createModifyDelta()
-
createDeleteDelta
ObjectDelta<O> createDeleteDelta()
-
setParent
void setParent(PrismContainerValue<?> parentValue)
Description copied from interface:Item
Sets the parent of this item.- Specified by:
setParent
in interfaceItem<PrismContainerValue<O extends Objectable>,PrismContainerDefinition<O extends Objectable>>
- Parameters:
parentValue
- The new parent
-
getParent
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 interfaceItem<PrismContainerValue<O extends Objectable>,PrismContainerDefinition<O extends Objectable>>
- Returns:
- The parent if exists
-
getPath
@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 interfaceItem<PrismContainerValue<O extends Objectable>,PrismContainerDefinition<O extends Objectable>>
- Specified by:
getPath
in interfaceItemable
- Returns:
- the path
-
equals
boolean equals(Object obj)
Description copied from interface:Item
Compares this item to the specified object under NOT_LITERAL strategy (if no other is pre-set).- Specified by:
equals
in interfaceItem<PrismContainerValue<O extends Objectable>,PrismContainerDefinition<O extends Objectable>>
- Overrides:
equals
in classObject
-
equivalent
boolean equivalent(Object obj)
this method ignores some part of the object during comparison (e.g. source demarcation in values) These methods compare the "meaningful" parts of the objects.- Specified by:
equivalent
in interfacePrismContainer<O extends Objectable>
-
toString
String toString()
- Specified by:
toString
in interfacePrismContainer<O extends Objectable>
- Overrides:
toString
in classObject
-
toDebugName
String toDebugName()
Returns short string representing identity of this object. It should container object type, OID and name. It should be presented in a form suitable for log and diagnostic messages (understandable for system administrator).
-
toDebugType
String toDebugType()
Returns short string identification of object type. It should be in a form suitable for log messages. There is no requirement for the type name to be unique, but it rather has to be compact. E.g. short element names are preferred to long QNames or URIs.
-
getBusinessDisplayName
String getBusinessDisplayName()
Return display name intended for business users of midPoint
-
checkConsistenceInternal
void checkConsistenceInternal(Itemable rootItem, boolean requireDefinitions, boolean prohibitRaw, ConsistencyCheckScope scope)
- Specified by:
checkConsistenceInternal
in interfaceItem<PrismContainerValue<O extends Objectable>,PrismContainerDefinition<O extends Objectable>>
- Specified by:
checkConsistenceInternal
in interfacePrismContainer<O extends Objectable>
-
setImmutable
void setImmutable(boolean immutable)
- Specified by:
setImmutable
in interfaceItem<PrismContainerValue<O extends Objectable>,PrismContainerDefinition<O extends Objectable>>
-
cloneIfImmutable
PrismObject<O> cloneIfImmutable()
-
createImmutableClone
PrismObject<O> createImmutableClone()
-
asObjectableList
@NotNull static <T extends Objectable> List<T> asObjectableList(@NotNull List<PrismObject<T>> objects)
-
asPrismObject
static PrismObject<?> asPrismObject(Objectable o)
-
asObjectable
static <T extends Objectable> T asObjectable(PrismObject<T> object)
-
-