com.atlassian.greenhopper.web.rapid.issue
Class StatisticFieldHelper

java.lang.Object
  extended by com.atlassian.greenhopper.web.rapid.issue.StatisticFieldHelper

@Service
public class StatisticFieldHelper
extends java.lang.Object

Helper methods for creating RapidIssueEntry.StatisticFieldValue representation of an estimate statistic StatisticsField.


Constructor Summary
StatisticFieldHelper()
           
 
Method Summary
 RapidIssueEntry.StatisticFieldValue createEstimateStatistic(com.atlassian.jira.issue.Issue issue, IssueStatisticValueResolver issueStatisticValueResolver)
          Creates a representation of a RapidIssueEntry.StatisticFieldValue for the given issue and IssueStatisticValueResolver.
 RapidIssueEntry.StatisticFieldValue createEstimateStatistic(java.lang.Long projectId, java.lang.String issueTypeId, java.lang.String documentValue, DocumentStatisticValueResolver documentStatisticValueResolver)
          Creates a representation of a RapidIssueEntry.StatisticFieldValue for the given document value and DocumentStatisticValueResolver.
 RapidIssueEntry.StatisticFieldValue createIssueCountEstimateStatistic()
          Shortcut for creating a RapidIssueEntry.StatisticFieldValue when we know the configured StatisticsField is of type StatisticsFieldConfig.Type#ISSUE_COUNT.
 RapidIssueEntry.StatisticFieldValue createTrackingStatistic(java.lang.Long projectId, java.lang.String issueTypeId, java.lang.String documentValue, DocumentStatisticValueResolver documentStatisticValueResolver)
          Creates a representation of a RapidIssueEntry.StatisticFieldValue for the given document value and DocumentStatisticValueResolver.
 RapidIssueEntry.StatisticFieldValue createTrackingStatistic(StatisticsField estimateStatistic, java.lang.Long projectId, java.lang.String issueTypeId, com.atlassian.greenhopper.web.rapid.issue.StatisticFieldHelper.EnclosedValueResolver enclosedValueResolver)
           
 RapidIssueEntry.StatisticFieldValue createTrackingStatisticValue(DocumentStatisticValueResolver documentStatisticValueResolver, java.lang.Long projectId, java.lang.String issueTypeId, java.lang.Double value)
          Renders the tracking statistic for an already calculated value, such as aggregated statistic value (e.g.
 java.lang.String getEstimateStatisticFieldId(StatisticsField estimateStatistic, com.atlassian.jira.issue.Issue issue)
          Get the field ID of the estimate statistic for the specified issue.
 java.lang.String getTrackingStatisticFieldId(StatisticsField trackingStatistic, com.atlassian.jira.issue.Issue issue)
          Get the field ID of the tracking statistic for the specified issue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatisticFieldHelper

public StatisticFieldHelper()
Method Detail

getEstimateStatisticFieldId

public java.lang.String getEstimateStatisticFieldId(StatisticsField estimateStatistic,
                                                    com.atlassian.jira.issue.Issue issue)
Get the field ID of the estimate statistic for the specified issue. This is used when building up a representation of a single issue for the Details View, so that the UI can know which FieldEntry represents the estimate statistic.

Parameters:
estimateStatistic - the estimate statistic for the board
issue - the issue
Returns:
the ID of the field; null if the StatisticsField is invalid, not enabled or not applicable.

getTrackingStatisticFieldId

public java.lang.String getTrackingStatisticFieldId(StatisticsField trackingStatistic,
                                                    com.atlassian.jira.issue.Issue issue)
Get the field ID of the tracking statistic for the specified issue. This is used when building up a representation of a single issue for the Details View, so that the UI can know which FieldEntry represents the tracking statistic.

Parameters:
trackingStatistic - the tracking statistic of the board
issue - the issue
Returns:
the ID of the field; null if the StatisticsField is invalid, not enabled or not applicable.

createEstimateStatistic

public RapidIssueEntry.StatisticFieldValue createEstimateStatistic(com.atlassian.jira.issue.Issue issue,
                                                                   IssueStatisticValueResolver issueStatisticValueResolver)
Creates a representation of a RapidIssueEntry.StatisticFieldValue for the given issue and IssueStatisticValueResolver.

Parameters:
issue - the issue
issueStatisticValueResolver - the resolver for retrieving the value of the StatisticsField of interest from the issue
Returns:
the entry representation; null if the StatisticsField is invalid, not enabled or not applicable.
See Also:
StatisticValueResolver.getStatisticsField()

createEstimateStatistic

public RapidIssueEntry.StatisticFieldValue createEstimateStatistic(java.lang.Long projectId,
                                                                   java.lang.String issueTypeId,
                                                                   java.lang.String documentValue,
                                                                   DocumentStatisticValueResolver documentStatisticValueResolver)
Creates a representation of a RapidIssueEntry.StatisticFieldValue for the given document value and DocumentStatisticValueResolver.

Parameters:
projectId - the ID of the project that the document belongs to
issueTypeId - the ID of the issue type of the document
documentValue - the value that we are expecting to resolve to a statistic value from the document
documentStatisticValueResolver - the resolver for retrieving the value of the StatisticsField of interest from the document value
Returns:
the entry representation; null if the StatisticsField is invalid, not enabled or not applicable.
See Also:
StatisticValueResolver.getStatisticsField()

createTrackingStatistic

public RapidIssueEntry.StatisticFieldValue createTrackingStatistic(java.lang.Long projectId,
                                                                   java.lang.String issueTypeId,
                                                                   java.lang.String documentValue,
                                                                   DocumentStatisticValueResolver documentStatisticValueResolver)
Creates a representation of a RapidIssueEntry.StatisticFieldValue for the given document value and DocumentStatisticValueResolver.

Parameters:
projectId - the ID of the project that the document belongs to
issueTypeId - the ID of the issue type of the document
documentValue - the value that we are expecting to resolve to a statistic value from the document
documentStatisticValueResolver - the resolver for retrieving the value of the StatisticsField of interest from the document value
Returns:
the entry representation; null if the StatisticsField is invalid, not enabled or not applicable.
See Also:
StatisticValueResolver.getStatisticsField()

createTrackingStatisticValue

public RapidIssueEntry.StatisticFieldValue createTrackingStatisticValue(DocumentStatisticValueResolver documentStatisticValueResolver,
                                                                        java.lang.Long projectId,
                                                                        java.lang.String issueTypeId,
                                                                        java.lang.Double value)
Renders the tracking statistic for an already calculated value, such as aggregated statistic value (e.g. time tracking in plan mode)


createTrackingStatistic

public RapidIssueEntry.StatisticFieldValue createTrackingStatistic(StatisticsField estimateStatistic,
                                                                   java.lang.Long projectId,
                                                                   java.lang.String issueTypeId,
                                                                   com.atlassian.greenhopper.web.rapid.issue.StatisticFieldHelper.EnclosedValueResolver enclosedValueResolver)

createIssueCountEstimateStatistic

public RapidIssueEntry.StatisticFieldValue createIssueCountEstimateStatistic()
Shortcut for creating a RapidIssueEntry.StatisticFieldValue when we know the configured StatisticsField is of type StatisticsFieldConfig.Type#ISSUE_COUNT.

Returns:
the representation of the value of a statistic field when the configured statistic is issue count


Copyright © 2007-2013 Atlassian. All Rights Reserved.