Package com.atlassian.jira.issue.util
Class AggregateTimeTrackingBean
java.lang.Object
com.atlassian.jira.issue.util.AggregateTimeTrackingBean
Bean to store values of Time Tracking Aggregate values.
It is more efficient to calculate them all at the same time (looping only once), and an instance of this is returned.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAggregateTimeTrackingBean(Long originalEstimate, Long remainingEstimate, Long timeSpent, int subtaskCount) -
Method Summary
Modifier and TypeMethodDescriptionstatic LongaddAndPreserveNull(Long estValue, Long origValue) Method to calculate the addition of two Longs, while preserving null if they are both null.voidbumpGreatestSubTaskEstimate(Long originalEstimate, Long remainingEstimate, Long timeSpent) When this is called, the current values of the bean are used to work out the greatest sub-task estimate.This property is used to track the largest sub-task estimate encountered so far.intstatic LonggetTheGreaterOfEstimates(Long originalEstimate, Long remainingEstimate, Long timeSpent) Finds the greater of the original estimate OR the remaining estimate plus the time spent.voidsetGreastestSubTaskEstimate(Long greastestSubTaskEstimate) voidsetOriginalEstimate(Long originalEstimate) voidsetRemainingEstimate(Long remainingEstimate) voidsetSubTaskCount(int subtaskCount) voidsetTimeSpent(Long timeSpent)
-
Field Details
-
AGG_TIMETRACKING
- See Also:
-
-
Constructor Details
-
AggregateTimeTrackingBean
-
-
Method Details
-
getTimeSpent
-
setTimeSpent
-
getOriginalEstimate
-
setOriginalEstimate
-
getRemainingEstimate
-
setRemainingEstimate
-
getSubTaskCount
public int getSubTaskCount() -
setSubTaskCount
public void setSubTaskCount(int subtaskCount) -
getGreastestSubTaskEstimate
This property is used to track the largest sub-task estimate encountered so far. Need to help the UI work out how big things should be when it is called piece meal to render the UI. It- Returns:
- a Long value which is the greater of the original estimate OR the remaining estimate plus the time spent.
-
setGreastestSubTaskEstimate
-
bumpGreatestSubTaskEstimate
public void bumpGreatestSubTaskEstimate(Long originalEstimate, Long remainingEstimate, Long timeSpent) When this is called, the current values of the bean are used to work out the greatest sub-task estimate. TimeSpent is added to remainingEstimate and compared to teh originalEstimate. The larger is then compared with the beans current greatest estimate and replaces it if greater.- Parameters:
originalEstimate- an issue's original estimateremainingEstimate- an issue's remaining estimatetimeSpent- an issue time spent
-
getTheGreaterOfEstimates
public static Long getTheGreaterOfEstimates(Long originalEstimate, Long remainingEstimate, Long timeSpent) Finds the greater of the original estimate OR the remaining estimate plus the time spent.- Parameters:
originalEstimate- original estimateremainingEstimate- remaining estimatetimeSpent- the time spent- Returns:
- the greater of the original estimate OR the remaining estimate plus the time spent.
-
addAndPreserveNull
Method to calculate the addition of two Longs, while preserving null if they are both null.- Parameters:
estValue- value from issueorigValue- value from bean- Returns:
- new Long based on the addition of the params.
-