Interface IObjectId
- All Known Implementing Classes:
ObjectId
public interface IObjectId
Object identification (object id).
May be converted to and from
SubterraURI
by IObjectResolver
.
Sole implementation of this interface is ObjectId
.
Object id consists of (optional) context id and local id. Object id with context id is called cross-context id, without it is called context-less id.
Object id can be represented as "normalized" string with exact format: context-less id is normalized local id, cross-context id is normalized context id, dollar sign ('$') and normalized local id. Additionally it can be represented as "prototype-less" normalized string where local id is in prototype-less normalized string form.
Implementations of this class must be immutable.
- Author:
- Stepan Roh, Polarion Software
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Delimiter between context id and local id in normalized string representation.static final char
Delimiter between context id and local id in normalized string representation. -
Method Summary
Modifier and TypeMethodDescriptionContext id (if any).Local id.Remove context id (if any) from this object id and return new object id.Remove revision (if any) from this object id's local id and return new object id.setContextId
(IContextId contextId) Set context id of this object id and return new object id.setLocalId
(ILocalId localId) Set local id of this object id and return new object idsetRevision
(String revision) Set the revision of this object ID and return a new object ID.Return normalized string representation of this object id.Return prototype-less normalized string representation of this object id.
-
Field Details
-
CONTEXT_DELIM
Delimiter between context id and local id in normalized string representation.- See Also:
-
CONTEXT_DELIM_CHAR
static final char CONTEXT_DELIM_CHARDelimiter between context id and local id in normalized string representation.- See Also:
-
-
Method Details
-
getContextId
IContextId getContextId()Context id (if any).- Returns:
- context id or
null
-
getLocalId
ILocalId getLocalId()Local id.- Returns:
- local id
-
removeContextId
IObjectId removeContextId()Remove context id (if any) from this object id and return new object id.- Returns:
- new context-less object id
-
removeRevision
Remove revision (if any) from this object id's local id and return new object id.- Returns:
- new object id with revision removed from its local id
- Since:
- 3.10.2
-
setContextId
Set context id of this object id and return new object id.- Parameters:
contextId
- context id- Returns:
- new cross-context object id
- Throws:
IllegalArgumentException
- if contextId isnull
-
setLocalId
Set local id of this object id and return new object id- Parameters:
localId
- local id- Returns:
- new object id
- Throws:
IllegalArgumentException
- if localId isnull
-
setRevision
Set the revision of this object ID and return a new object ID.- Since:
- 3.24.10
-
toNormalizedString
String toNormalizedString()Return normalized string representation of this object id.- Returns:
- normalized string
-
toPrototypeLessNormalizedString
String toPrototypeLessNormalizedString()Return prototype-less normalized string representation of this object id.- Returns:
- normalized string
-