Class AggregateTimeTrackingBean

java.lang.Object
com.atlassian.jira.issue.util.AggregateTimeTrackingBean

public class AggregateTimeTrackingBean extends Object
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 Details

  • Constructor Details

    • AggregateTimeTrackingBean

      public AggregateTimeTrackingBean(Long originalEstimate, Long remainingEstimate, Long timeSpent, int subtaskCount)
  • Method Details

    • getTimeSpent

      public Long getTimeSpent()
    • setTimeSpent

      public void setTimeSpent(Long timeSpent)
    • getOriginalEstimate

      public Long getOriginalEstimate()
    • setOriginalEstimate

      public void setOriginalEstimate(Long originalEstimate)
    • getRemainingEstimate

      public Long getRemainingEstimate()
    • setRemainingEstimate

      public void setRemainingEstimate(Long remainingEstimate)
    • getSubTaskCount

      public int getSubTaskCount()
    • setSubTaskCount

      public void setSubTaskCount(int subtaskCount)
    • getGreastestSubTaskEstimate

      public Long 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

      public void setGreastestSubTaskEstimate(Long greastestSubTaskEstimate)
    • 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 estimate
      remainingEstimate - an issue's remaining estimate
      timeSpent - 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 estimate
      remainingEstimate - remaining estimate
      timeSpent - the time spent
      Returns:
      the greater of the original estimate OR the remaining estimate plus the time spent.
    • addAndPreserveNull

      public static Long addAndPreserveNull(Long estValue, Long origValue)
      Method to calculate the addition of two Longs, while preserving null if they are both null.
      Parameters:
      estValue - value from issue
      origValue - value from bean
      Returns:
      new Long based on the addition of the params.