Class WorkItem
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<String,Object>
-
- com.xwiki.projectmanagement.model.WorkItem
-
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,Object>
public class WorkItem extends HashMap<String,Object>
Describes an issue, a ticket, work package or some item coming from a project management tool.- Since:
- 1.0
- Version:
- $Id$
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_ASSIGNEESThe key identifying the assignees property of the work item.static StringKEY_CLOSE_DATEThe key identifying the closeDate property of the work item.static StringKEY_CLOSED_BYThe key identifying the closedBy property of the work item.static StringKEY_CREATION_DATEThe key identifying the creationDate property of the work item.static StringKEY_CREATORThe key identifying the creator property of the work item.static StringKEY_DESCRIPTIONThe key identifying the description property of the work item.static StringKEY_DUE_DATEThe key identifying the dueDate property of the work item.static StringKEY_IDENTIFIERThe key identifying the identifier property of the work item.static StringKEY_LABELSThe key identifying the labels property of the work item.static StringKEY_MILESTONESThe key identifying the milestones property of the work item.static StringKEY_PRIORITYThe key identifying the priority property of the work item.static StringKEY_PROGRESSThe key identifying the progress property of the work item.static StringKEY_PROJECTThe key identifying the project property of the work item.static StringKEY_REPORTERThe key identifying the reporter property of the work item.static StringKEY_RESOLUTIONThe key identifying the resolution property of the work item.static StringKEY_RESOLVEDThe key identifying the resolved property of the work item.static StringKEY_START_DATEThe key identifying the startDate property of the work item.static StringKEY_STATUSThe key identifying the status property of the work item.static StringKEY_SUMMARYThe key identifying the summary property of the work item.static StringKEY_TYPEThe key identifying the type property of the work item.static StringKEY_UPDATE_DATEThe key identifying the updateDate property of the work item.
-
Constructor Summary
Constructors Constructor Description WorkItem()
-
Method Summary
-
Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
-
-
-
Field Detail
-
KEY_TYPE
public static final String KEY_TYPE
The key identifying the type property of the work item.- See Also:
- Constant Field Values
-
KEY_IDENTIFIER
public static final String KEY_IDENTIFIER
The key identifying the identifier property of the work item.- See Also:
- Constant Field Values
-
KEY_SUMMARY
public static final String KEY_SUMMARY
The key identifying the summary property of the work item.- See Also:
- Constant Field Values
-
KEY_DESCRIPTION
public static final String KEY_DESCRIPTION
The key identifying the description property of the work item.- See Also:
- Constant Field Values
-
KEY_START_DATE
public static final String KEY_START_DATE
The key identifying the startDate property of the work item.- See Also:
- Constant Field Values
-
KEY_DUE_DATE
public static final String KEY_DUE_DATE
The key identifying the dueDate property of the work item.- See Also:
- Constant Field Values
-
KEY_PROGRESS
public static final String KEY_PROGRESS
The key identifying the progress property of the work item.- See Also:
- Constant Field Values
-
KEY_CREATION_DATE
public static final String KEY_CREATION_DATE
The key identifying the creationDate property of the work item.- See Also:
- Constant Field Values
-
KEY_UPDATE_DATE
public static final String KEY_UPDATE_DATE
The key identifying the updateDate property of the work item.- See Also:
- Constant Field Values
-
KEY_CREATOR
public static final String KEY_CREATOR
The key identifying the creator property of the work item.- See Also:
- Constant Field Values
-
KEY_ASSIGNEES
public static final String KEY_ASSIGNEES
The key identifying the assignees property of the work item.- See Also:
- Constant Field Values
-
KEY_PRIORITY
public static final String KEY_PRIORITY
The key identifying the priority property of the work item.- See Also:
- Constant Field Values
-
KEY_PROJECT
public static final String KEY_PROJECT
The key identifying the project property of the work item.- See Also:
- Constant Field Values
-
KEY_STATUS
public static final String KEY_STATUS
The key identifying the status property of the work item.- See Also:
- Constant Field Values
-
KEY_REPORTER
public static final String KEY_REPORTER
The key identifying the reporter property of the work item.- See Also:
- Constant Field Values
-
KEY_RESOLUTION
public static final String KEY_RESOLUTION
The key identifying the resolution property of the work item.- See Also:
- Constant Field Values
-
KEY_RESOLVED
public static final String KEY_RESOLVED
The key identifying the resolved property of the work item.- See Also:
- Constant Field Values
-
KEY_LABELS
public static final String KEY_LABELS
The key identifying the labels property of the work item.- See Also:
- Constant Field Values
-
KEY_CLOSE_DATE
public static final String KEY_CLOSE_DATE
The key identifying the closeDate property of the work item.- See Also:
- Constant Field Values
-
KEY_MILESTONES
public static final String KEY_MILESTONES
The key identifying the milestones property of the work item.- See Also:
- Constant Field Values
-
KEY_CLOSED_BY
public static final String KEY_CLOSED_BY
The key identifying the closedBy property of the work item.- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
public String getType()
- Returns:
- the type of the work item. i.e. task, bug, epic, etc.
-
getIdentifier
public Linkable getIdentifier()
- Returns:
- the identifier for this work item together with a link to its location. For example, Open project and GitHub identify work packages numerically: '1001', Jira using a key: 'XWIKI-1001'.
-
setIdentifier
public void setIdentifier(Linkable identifier)
- Parameters:
identifier- seegetIdentifier().
-
getSummary
public Linkable getSummary()
- Returns:
- a text summarizing this work item together with a link to its location. On some platform, this property translates to the issue title.
-
setSummary
public void setSummary(Linkable summary)
- Parameters:
summary- seegetSummary().
-
getDescription
public String getDescription()
- Returns:
- a text that describes this work item.
-
setDescription
public void setDescription(String description)
- Parameters:
description- seegetDescription().
-
getStartDate
public Date getStartDate()
- Returns:
- the date when this work item was marked, by some user/entity, as started.
-
setStartDate
public void setStartDate(Date startDate)
- Parameters:
startDate- seegetStartDate().
-
getDueDate
public Date getDueDate()
- Returns:
- the date when this work item is expected to be finished, set as resolved.
-
setDueDate
public void setDueDate(Date dueDate)
- Parameters:
dueDate- seegetDueDate().
-
getProgress
public Integer getProgress()
- Returns:
- the progress, as a percentage, that has been done for this work item.
-
setProgress
public void setProgress(Integer progress)
- Parameters:
progress- seegetProgress().
-
getCreationDate
public Date getCreationDate()
- Returns:
- the date when this work item was created.
-
setCreationDate
public void setCreationDate(Date creationDate)
- Parameters:
creationDate- seegetCreationDate().
-
getUpdateDate
public Date getUpdateDate()
- Returns:
- the last date when this work item was updated or modified.
-
setUpdateDate
public void setUpdateDate(Date updateDate)
- Parameters:
updateDate- seegetUpdateDate().
-
getCreator
public Linkable getCreator()
- Returns:
- a tuple identifying the creator of this work item. The tuple contains the display name of the user and a link to their profile location.
-
setCreator
public void setCreator(Linkable creator)
- Parameters:
creator- seegetCreator().
-
getAssignees
public List<Linkable> getAssignees()
- Returns:
- a list of users assigned to this work item. Each user is a tuple containing the display name and the location to their profile location.
-
setAssignees
public void setAssignees(List<Linkable> assignees)
- Parameters:
assignees- seegetAssignees().
-
getPriority
public String getPriority()
- Returns:
- the priority that was assigned to this work item. i.e. "minor", "critical", "major", etc.
-
setPriority
public void setPriority(String priority)
- Parameters:
priority- seegetPriority().
-
getProject
public Linkable getProject()
- Returns:
- a tuple identifying the project where this work item belongs. The tuple contains the display name of the project and a link to its location.
-
setProject
public void setProject(Linkable project)
- Parameters:
project- seegetProject().
-
getStatus
public String getStatus()
- Returns:
- the current status of this work item.
-
setStatus
public void setStatus(String status)
- Parameters:
status- seegetStatus().
-
getReporter
public Linkable getReporter()
- Returns:
- a tuple representing the user thanks to whom this work item was created. If this work item represents a bug, it could be that somebody reported it and someone else created the ticket.
-
setReporter
public void setReporter(Linkable reporter)
- Parameters:
reporter- seegetReporter().
-
getResolution
public String getResolution()
- Returns:
- the resolution for this work item. A work item can be marked as resolved but it might need additional information on how it was closed. i.e. "duplicate", "won't resolve", "canceled" etc.
-
setResolution
public void setResolution(String resolution)
- Parameters:
resolution- seegetResolution().
-
isResolved
public boolean isResolved()
- Returns:
- denotes whether this work item is closed/resolved or not.
-
setResolved
public void setResolved(boolean resolved)
- Parameters:
resolved- seeisResolved().
-
getLabels
public List<String> getLabels()
- Returns:
- a list of labels that were assigned to this work item.
-
setLabels
public void setLabels(List<String> labels)
- Parameters:
labels- seegetLabels().
-
getCloseDate
public Date getCloseDate()
- Returns:
- the date when this work item was marked as closed.
-
setCloseDate
public void setCloseDate(Date closeDate)
- Parameters:
closeDate- seegetCloseDate().
-
getMilestones
public Linkable getMilestones()
- Returns:
- a tuple identifying the milestone that was associated to this work item. i.e. on Github one can associate a closed issue to a software milestone, in the case of Jira, an issue can have a 'fix version'.
-
setMilestones
public void setMilestones(Linkable milestones)
- Parameters:
milestones- seegetMilestones().
-
getClosedBy
public Linkable getClosedBy()
- Returns:
- a tuple that identifies the user that closed this work item. The user is identified through their display name and a link to the location of their profile.
-
setClosedBy
public void setClosedBy(Linkable closedBy)
- Parameters:
closedBy- seegetClosedBy().
-
putEntry
public void putEntry(String key, Object value)
- Parameters:
key- the key.value- the value.
-
getLinkable
public Map<String,Object> getLinkable(String key)
Utility method that retrieves a linkable property.- Parameters:
key- the key of the linkable property. i.e. identifier, summary.- Returns:
- the linkable property as a map or an empty map if nothing was found.
-
getLinkableValue
public String getLinkableValue(String key)
Utility method that retrieves the value of a linkable property.- Parameters:
key- the key of the linkable property. i.e. identifier, summary.- Returns:
- the value of the linkable property or null if the linkable property does not exist.
-
getLinkableLocation
public String getLinkableLocation(String key)
Utility method that retrieves the location of a linkable property.- Parameters:
key- the key of the linkable property. i.e. identifier, summary.- Returns:
- the location of the linkable property or null if the linkable property does not exist.
-
-