Class WorkItemReference
java.lang.Object
com.polarion.alm.shared.api.model.ModelEntityReferenceBase<T,R>
com.polarion.alm.shared.api.model.ModelObjectReferenceBase<T,R>
com.polarion.alm.shared.api.model.ModelObjectReferenceWithUpdatable<WorkItem,UpdatableWorkItem,WorkItemReference>
com.polarion.alm.shared.api.model.wi.WorkItemReference
- All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable
,HasId
,HasProjectId
,HasRelativePath
,ModelEntityReference
,ModelObjectReference
,ReferenceWithUpdatable<UpdatableWorkItem>
,HasPortalLink
,Serializable
public final class WorkItemReference
extends ModelObjectReferenceWithUpdatable<WorkItem,UpdatableWorkItem,WorkItemReference>
implements HasId, HasProjectId, HasPortalLink, HasRelativePath
- Since:
- 3.9.0
- See Also:
-
Constructor Summary
ConstructorDescriptionWorkItemReference
(String projectId, String id) WorkItemReference
(String projectId, String id, String requestedRevision, String actualRevision) -
Method Summary
Modifier and TypeMethodDescriptioncreateLink
(SharedContext context) Creates portal link.boolean
static WorkItemReference
The path is trimmed before parsing, so it can contain spaces at the start or end.static WorkItemReference
fromRelativePath
(String baseProjectId, String path) The path is trimmed before parsing, so it can contain spaces at the start or end.
The path can be obtained usingtoRelativePath(String)
.Returns the reference to current revision of the object, in other words reference without requested revision and actual revision.getFromRevision
(ReadOnlyTransaction transaction, String requestedRevision) getWithRevision
(String requestedRevision) Returns the reference to the same object, but with differentModelObjectReference.requestedRevision()
, theModelObjectReference.actualRevision()
of the returned reference is null.int
hashCode()
id()
It is shortcut forModelObjectReference.scope()
.Scope.projectId()
scope()
toPath()
Returns 'projectId/wiId'toRelativePath
(String baseProjectId) Returns theid()
if the baseProjectId is same asprojectId()
otherwise returns the same value astoPath()
.
ThefromRelativePath(String, String)
can be used to get the reference from the returned path.Methods inherited from class com.polarion.alm.shared.api.model.ModelObjectReferenceWithUpdatable
getUpdatable
Methods inherited from class com.polarion.alm.shared.api.model.ModelObjectReferenceBase
actualRevision, get, getCurrent, getOriginal, requestedRevision, toString
-
Constructor Details
-
WorkItemReference
public WorkItemReference(@NotNull String projectId, @NotNull String id, @Nullable String requestedRevision, @Nullable String actualRevision) - Throws:
IllegalArgumentException
- when projectId or id is empty string
-
WorkItemReference
- Throws:
IllegalArgumentException
- when projectId or id is empty string- Since:
- 3.9.1
-
-
Method Details
-
fromPath
The path is trimmed before parsing, so it can contain spaces at the start or end.- Throws:
IllegalArgumentException
- when path does not contain '/' character or when it is at the start or end.- See Also:
-
fromRelativePath
@NotNull public static WorkItemReference fromRelativePath(@Nullable String baseProjectId, @NotNull String path) The path is trimmed before parsing, so it can contain spaces at the start or end.
The path can be obtained usingtoRelativePath(String)
. The baseProjectId used in both calls must be the same.- Throws:
IllegalArgumentException
- in same conditions asfromPath(String)
when baseProjectId is null, otherwise when path start or ends with '/' characters- Since:
- 3.9.1
-
projectId
Description copied from interface:ModelObjectReference
It is shortcut forModelObjectReference.scope()
.Scope.projectId()
- Specified by:
projectId
in interfaceHasProjectId
- Specified by:
projectId
in interfaceModelObjectReference
- Overrides:
projectId
in classModelObjectReferenceBase<WorkItem,
WorkItemReference>
-
id
-
toPath
Returns 'projectId/wiId'- Specified by:
toPath
in interfaceModelEntityReference
- Specified by:
toPath
in interfaceModelObjectReference
- See Also:
-
toRelativePath
Returns theid()
if the baseProjectId is same asprojectId()
otherwise returns the same value astoPath()
.
ThefromRelativePath(String, String)
can be used to get the reference from the returned path. The baseProjectId used in both calls must be the same.- Specified by:
toRelativePath
in interfaceHasRelativePath
- Parameters:
baseProjectId
- - null means global scope- Since:
- 3.9.1
-
scope
- Specified by:
scope
in interfaceModelObjectReference
-
getCurrent
Description copied from interface:ModelObjectReference
Returns the reference to current revision of the object, in other words reference without requested revision and actual revision. It is shortcut for callingModelObjectReference.getWithRevision(String)
with null- Specified by:
getCurrent
in interfaceModelObjectReference
- Overrides:
getCurrent
in classModelObjectReferenceBase<WorkItem,
WorkItemReference>
-
getWithRevision
Description copied from interface:ModelObjectReference
Returns the reference to the same object, but with differentModelObjectReference.requestedRevision()
, theModelObjectReference.actualRevision()
of the returned reference is null.- Specified by:
getWithRevision
in interfaceModelObjectReference
- Specified by:
getWithRevision
in classModelObjectReferenceBase<WorkItem,
WorkItemReference> - See Also:
-
hashCode
public int hashCode()- Overrides:
hashCode
in classModelObjectReferenceBase<WorkItem,
WorkItemReference>
-
equals
- Overrides:
equals
in classModelObjectReferenceBase<WorkItem,
WorkItemReference>
-
prototype
- Specified by:
prototype
in interfaceModelObjectReference
-