Interface PrismObject<O extends Objectable>
- All Superinterfaces:
DebugDumpable
,Freezable
,Item<PrismContainerValue<O>,
,PrismContainerDefinition<O>> Itemable
,ParentVisitable
,PathVisitable
,PrismContainer<O>
,PrismContainerable<O>
,Revivable
,Serializable
,Visitable
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
Fields inherited from interface com.evolveum.midpoint.prism.Item
KEY_NAMESPACE_CONTEXT
-
Method Summary
Modifier and TypeMethodDescription<I extends Item<?,
?>>
voidaddExtensionItem
(I item) void
addReplaceExisting
(Item<?, ?> item) static <T extends Objectable>
TasObjectable
(PrismObject<T> object) static <T extends Objectable>
@NotNull List<T>asObjectableList
(@NotNull List<PrismObject<T>> objects) static PrismObject<?>
static <T extends Objectable>
PrismObject<T>cast
(PrismObject<?> object, Class<T> type) clone()
Literal clone.cloneComplex
(CloneStrategy strategy) Complex clone with different cloning strategies.createDelta
(ChangeType changeType) deepCloneDefinition
(@NotNull DeepCloneOperation operation) @NotNull ObjectDelta<O>
diff
(PrismObject<O> other) @NotNull ObjectDelta<O>
diff
(PrismObject<O> other, ParameterizedEquivalenceStrategy strategy) 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) Return display name intended for business users of midPointReturns applicable definition.getName()
getOid()
Returns Object ID (OID).Returns the parent of this item (if exists).@NotNull PrismObjectValue<O>
getValue()
Returns the value, if there is only one.default boolean
Collection<? extends ItemDelta<?,
?>> narrowModifications
(Collection<? extends ItemDelta<?, ?>> modifications, @NotNull ParameterizedEquivalenceStrategy plusStrategy, @NotNull ParameterizedEquivalenceStrategy minusStrategy, boolean assumeMissingItems) See description ofItemDelta.narrow(PrismObject, Comparator, Comparator, boolean)
method.<IV extends PrismValue,
ID extends ItemDefinition<?>, I extends Item<IV, ID>>
voidremoveItem
(ItemPath path, Class<I> itemType) void
void
setParent
(PrismContainerValue<?> parentValue) Sets the parent of this item.void
setValue
(@NotNull PrismContainerValue<O> value) void
setVersion
(String version) Returns short string representing identity of this object.Returns short string identification of object type.Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDump, debugDumpLazily, debugDumpLazily
Methods inherited from interface com.evolveum.midpoint.prism.Freezable
checkImmutable, checkMutable, freeze, isImmutable
Methods inherited from interface com.evolveum.midpoint.prism.Item
acceptParentVisitor, add, add, addAll, addAll, addIgnoringEquivalents, addRespectingMetadataAndCloning, applyDefinition, applyDefinition, applyDefinitionIfMissing, assertDefinitions, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistenceInternal, clear, contains, contains, copy, diff, diff, equals, equals, equals, filterValues, filterYields, find, findValue, findValue, getAllItems, getAllValues, getAnyValue, getAnyValue, getClonedValues, getDisplayName, getElementName, getHelp, getHighestId, getNamespaceContext, getPath, getRealValue, getRealValues, getRealValuesArray, getRealValuesOrRawTypes, getUserData, getUserData, hasAnyValue, hasCompleteDefinition, hashCode, hashCode, hashCode, hasNoValues, hasRaw, isEmpty, isIncomplete, isOperational, isRaw, isSingleValue, isSingleValueByDefinition, merge, normalize, recomputeAllValues, remove, remove, removeAll, removeIf, removeRespectingMetadata, replace, replaceAll, setDefinition, setElementName, setIncomplete, setUserData, size, valuesStream
Methods inherited from interface com.evolveum.midpoint.prism.PrismContainer
accept, add, canRepresent, canRepresent, containsItem, createDelta, createDelta, diff, diff, diffModifications, findContainer, findCreateItem, findCreateItem, findItem, findItem, findItem, findOrCreateContainer, findOrCreateItem, findOrCreateItem, findOrCreateProperty, findOrCreateReference, findPartial, findProperty, findReference, findValue, getCompileTimeClass, getPropertyRealValue, getRealValue, getRealValues, getValue, getValues, mergeValue, mergeValues, mergeValues, remove, removeContainer, removeProperty, removeReference, setContainerRealValue, setPropertyRealValue, setPropertyRealValues, setRealValue, trim, trimDefinitionTree
Methods inherited from interface com.evolveum.midpoint.prism.PrismContainerable
getComplexTypeDefinition
-
Method Details
-
createNewValue
PrismObjectValue<O> createNewValue()- Specified by:
createNewValue
in interfacePrismContainer<O extends Objectable>
-
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
- 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
-
getVersion
String getVersion() -
setVersion
-
getDefinition
PrismObjectDefinition<O> 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 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 definition
-
asObjectable
-
getName
PolyString getName() -
getExtension
PrismContainer<?> getExtension() -
getOrCreateExtension
- Throws:
SchemaException
-
getExtensionContainerValue
PrismContainerValue<?> getExtensionContainerValue() -
findExtensionItem
-
findExtensionItem
-
addExtensionItem
- Throws:
SchemaException
-
createExtension
- Throws:
SchemaException
-
removeItem
<IV extends PrismValue,ID extends ItemDefinition<?>, void removeItemI extends Item<IV, ID>> (ItemPath path, Class<I> itemType) - Specified by:
removeItem
in interfacePrismContainer<O extends Objectable>
-
addReplaceExisting
- 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
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:
-
deepCloneDefinition
- Specified by:
deepCloneDefinition
in interfacePrismContainer<O extends Objectable>
-
diff
-
diff
@NotNull @NotNull ObjectDelta<O> diff(PrismObject<O> other, ParameterizedEquivalenceStrategy strategy) -
narrowModifications
Collection<? extends ItemDelta<?,?>> narrowModifications(Collection<? extends ItemDelta<?, ?>> modifications, @NotNull @NotNull ParameterizedEquivalenceStrategy plusStrategy, @NotNull @NotNull ParameterizedEquivalenceStrategy minusStrategy, boolean assumeMissingItems) See description ofItemDelta.narrow(PrismObject, Comparator, Comparator, boolean)
method. -
createDelta
-
createAddDelta
ObjectDelta<O> createAddDelta() -
createModifyDelta
ObjectDelta<O> createModifyDelta() -
createDeleteDelta
ObjectDelta<O> createDeleteDelta() -
setParent
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
-
equivalent
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>
-
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 -
cloneIfImmutable
PrismObject<O> cloneIfImmutable() -
createImmutableClone
PrismObject<O> createImmutableClone()- Specified by:
createImmutableClone
in interfaceItem<PrismContainerValue<O extends Objectable>,
PrismContainerDefinition<O extends Objectable>> - Specified by:
createImmutableClone
in interfacePrismContainer<O extends Objectable>
-
asObjectableList
@NotNull static <T extends Objectable> @NotNull List<T> asObjectableList(@NotNull @NotNull List<PrismObject<T>> objects) -
asPrismObject
-
asObjectable
-
isOfType
-
cast
@Experimental static <T extends Objectable> PrismObject<T> cast(PrismObject<?> object, Class<T> type)
-