Interface PrismObject<O extends Objectable>
-
- All Superinterfaces:
DebugDumpable
,Freezable
,Item<PrismContainerValue<O>,PrismContainerDefinition<O>>
,Itemable
,ParentVisitable
,PathVisitable
,PrismContainer<O>
,PrismContainerable<O>
,PrismContextSensitive
,Revivable
,Serializable
,Visitable
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
-
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, assertDefinitions, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistence, checkConsistenceInternal, clear, contains, contains, copy, diff, diff, equals, equals, equals, filterValues, filterYields, find, findValue, findValue, getAllValues, getAnyValue, getAnyValue, getClonedValues, getDisplayName, getElementName, getHelp, getHighestId, getPath, getPrismContextLocal, getRealValue, getRealValuesArray, getRealValuesOrRawTypes, getUserData, getUserData, getValues, hasAnyValue, hasCompleteDefinition, hashCode, hashCode, hashCode, hasNoValues, hasRaw, isEmpty, isIncomplete, isOperational, isRaw, isSingleValue, isSingleValueByDefinition, merge, normalize, recomputeAllValues, remove, remove, removeAll, removeIf, removeRespectingMetadata, replace, replaceAll, setElementName, setIncomplete, setPrismContext, 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, mergeValue, mergeValues, mergeValues, remove, removeContainer, removeProperty, removeReference, setContainerRealValue, setDefinition, setPropertyRealValue, setPropertyRealValues, setRealValue, trim, trimDefinitionTree
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismContainerable
getComplexTypeDefinition
-
Methods inherited from interface com.evolveum.midpoint.prism.PrismContextSensitive
getPrismContext
-
-
-
-
Method Detail
-
createNewValue
PrismObjectValue<O> createNewValue()
- Specified by:
createNewValue
in interfacePrismContainer<O extends Objectable>
-
getValue
@NotNull @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 @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: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
@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 @NotNull ObjectDelta<O> diff(PrismObject<O> other)
-
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
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
-
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>
-
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
static PrismObject<?> asPrismObject(Objectable o)
-
asObjectable
static <T extends Objectable> T asObjectable(PrismObject<T> object)
-
isOfType
default boolean isOfType(@NotNull @NotNull Class<?> type)
-
cast
@Experimental static <T extends Objectable> PrismObject<T> cast(PrismObject<?> object, Class<T> type)
-
-