Class EstimateStatisticServiceImpl
java.lang.Object
com.atlassian.greenhopper.service.rapid.view.statistics.EstimateStatisticServiceImpl
- All Implemented Interfaces:
EstimateStatisticService
@Service
public class EstimateStatisticServiceImpl
extends Object
implements EstimateStatisticService
Implementation of
EstimateStatisticService
. Similar to StatisticsFieldServiceImpl
.- Since:
- v5.9.5
-
Field Summary
FieldsFields inherited from interface com.atlassian.greenhopper.service.rapid.view.statistics.EstimateStatisticService
ORIGINAL_ESTIMATE_FIELD_ID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the list ofStatisticsField
s which represent the availableStatisticsFieldConfig
s.getEstimateStatistic
(RapidView rapidView) Will always return aStatisticsField
, which may or may not be valid.getEstimateStatisticStrict
(RapidView rapidView) Attempts to get theStatisticsField
of a rapid view.getInstanceOf
(StatisticsFieldConfig config) Retrieve the StatisticsField configured in the StatisticFieldConfiggetInvalidEstimateStatistic
(RapidView rapidView) Returns aStatisticsField
instance which represents an invalidStatisticsFieldConfig
.boolean
isEstimateStatisticFieldAndNotApplicable
(StatisticsField estimateStatistic, com.atlassian.jira.issue.Issue issue) Is theStatisticsField
field based but not applicable for the given issue?boolean
isEstimateStatisticFieldAndNotApplicable
(StatisticsField estimateStatistic, Long projectId, String issueTypeId) Is theStatisticsField
field based but not applicable for the given project and issue type?boolean
isEstimateStatisticValidAndEnabled
(StatisticsField estimateStatistic) Is theStatisticsField
valid and enabled (i.e. should it take part in accumulating statistics over issues)?updateEstimateStatistic
(com.atlassian.jira.user.ApplicationUser user, RapidView rapidView, StatisticsFieldConfig estimateStatistic) Updates the specified rapid view to a new configuration.
-
Field Details
-
ISSUE_COUNT_NAME_KEY
- See Also:
-
NONE_NAME_KEY
- See Also:
-
-
Constructor Details
-
EstimateStatisticServiceImpl
public EstimateStatisticServiceImpl()
-
-
Method Details
-
getAvailableEstimateStatistics
Returns the list ofStatisticsField
s which represent the availableStatisticsFieldConfig
s.- Specified by:
getAvailableEstimateStatistics
in interfaceEstimateStatisticService
- Returns:
- the list.
- See Also:
-
getAvailableConfigs()
-
updateEstimateStatistic
public ServiceResult updateEstimateStatistic(com.atlassian.jira.user.ApplicationUser user, RapidView rapidView, StatisticsFieldConfig estimateStatistic) Description copied from interface:EstimateStatisticService
Updates the specified rapid view to a new configuration.- Specified by:
updateEstimateStatistic
in interfaceEstimateStatisticService
- Parameters:
user
- the userrapidView
- the rapid viewestimateStatistic
- the new configuration- Returns:
- the outcome; possibly with errors
-
getEstimateStatisticStrict
Description copied from interface:EstimateStatisticService
Attempts to get theStatisticsField
of a rapid view. Outcome will contain errors if the configured estimate statistic is invalid. You may wish to callEstimateStatisticService.getInvalidEstimateStatistic(com.atlassian.greenhopper.model.rapid.RapidView)
in that case. If you just want either the valid or invalidStatisticsField
to be returned, callEstimateStatisticService.getEstimateStatistic(com.atlassian.greenhopper.model.rapid.RapidView)
.- Specified by:
getEstimateStatisticStrict
in interfaceEstimateStatisticService
- Parameters:
rapidView
- the rapid view- Returns:
- strict outcome of valid statistics field; or errors
- See Also:
-
getEstimateStatistic
Description copied from interface:EstimateStatisticService
Will always return aStatisticsField
, which may or may not be valid.- Specified by:
getEstimateStatistic
in interfaceEstimateStatisticService
- Parameters:
rapidView
- the rapid view- Returns:
- the statistic field
-
getInvalidEstimateStatistic
Description copied from interface:EstimateStatisticService
Returns aStatisticsField
instance which represents an invalidStatisticsFieldConfig
. This only really makes sense to call if you have previously calledEstimateStatisticService.getEstimateStatisticStrict(com.atlassian.greenhopper.model.rapid.RapidView)
and were returned errors.- Specified by:
getInvalidEstimateStatistic
in interfaceEstimateStatisticService
- Parameters:
rapidView
- the rapid view- Returns:
- the invalid instance representing the configuration
-
getInstanceOf
@Nonnull public ServiceOutcome<StatisticsField> getInstanceOf(@Nonnull StatisticsFieldConfig config) Description copied from interface:EstimateStatisticService
Retrieve the StatisticsField configured in the StatisticFieldConfig- Specified by:
getInstanceOf
in interfaceEstimateStatisticService
- Parameters:
config
- for the field- Returns:
- StatisticField if can be found.
-
isEstimateStatisticFieldAndNotApplicable
public boolean isEstimateStatisticFieldAndNotApplicable(StatisticsField estimateStatistic, com.atlassian.jira.issue.Issue issue) Description copied from interface:EstimateStatisticService
Is theStatisticsField
field based but not applicable for the given issue? (Due to Custom Field configuration contexts, for example.)- Specified by:
isEstimateStatisticFieldAndNotApplicable
in interfaceEstimateStatisticService
- Parameters:
estimateStatistic
- the estimate statisticissue
- the issue- Returns:
- the result
- See Also:
-
isEstimateStatisticFieldAndNotApplicable
public boolean isEstimateStatisticFieldAndNotApplicable(StatisticsField estimateStatistic, Long projectId, String issueTypeId) Description copied from interface:EstimateStatisticService
Is theStatisticsField
field based but not applicable for the given project and issue type? (Due to Custom Field configuration contexts, for example.)- Specified by:
isEstimateStatisticFieldAndNotApplicable
in interfaceEstimateStatisticService
- Parameters:
estimateStatistic
- the estimate statisticprojectId
- the ID of the projectissueTypeId
- the ID of the issue type- Returns:
- the result
- See Also:
-
isEstimateStatisticValidAndEnabled
Description copied from interface:EstimateStatisticService
Is theStatisticsField
valid and enabled (i.e. should it take part in accumulating statistics over issues)?- Specified by:
isEstimateStatisticValidAndEnabled
in interfaceEstimateStatisticService
- Parameters:
estimateStatistic
- the estimate statistic- Returns:
- the result
- See Also:
-