Class StatisticsFieldInstance
java.lang.Object
com.atlassian.greenhopper.model.rapid.StatisticsFieldInstance
- All Implemented Interfaces:
StatisticsField
Represents an instance of a
StatisticsFieldConfig for a RapidView. This should be used when "resolving"
the configuration of the Statistics Field in a request which requires real knowledge of how that configuration works
at run-time. Specifically, if a StatisticsFieldConfig has type StatisticsFieldConfig.Type.JIRA_FIELD,
the configuration will only tell you the ID of the field used, but this object will allow you to resolve the proper
name of that configuration, provided that the field is still around at this point.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic StatisticsFieldInstanceforJiraField(StatisticsFieldConfig config, com.atlassian.jira.issue.fields.Field field) static StatisticsFieldInstanceforJiraFieldWithName(StatisticsFieldConfig config, com.atlassian.jira.issue.fields.Field field, String nameKey) static StatisticsFieldInstanceforJiraFieldWithNameWithDocumentId(StatisticsFieldConfig config, com.atlassian.jira.issue.fields.Field field, String nameKey, String documentId) static StatisticsFieldInstanceforNonField(StatisticsFieldConfig config, String nameKey) Returns the configuration associated with this instance.getDisplayName(I18n2 i18n) Get the display name of this instanceNote: behaviour is only determined for this method whenStatisticsField.isValid()is true.com.atlassian.jira.issue.fields.FieldgetField()Returns the field that the configuration refers to, if it is still available at this time.booleanNote: this method cannot return true ifStatisticsField.isValid()is false.booleanbooleanisValid()
-
Method Details
-
forNonField
-
forJiraField
public static StatisticsFieldInstance forJiraField(StatisticsFieldConfig config, com.atlassian.jira.issue.fields.Field field) -
forJiraFieldWithName
public static StatisticsFieldInstance forJiraFieldWithName(StatisticsFieldConfig config, com.atlassian.jira.issue.fields.Field field, String nameKey) -
forJiraFieldWithNameWithDocumentId
public static StatisticsFieldInstance forJiraFieldWithNameWithDocumentId(StatisticsFieldConfig config, com.atlassian.jira.issue.fields.Field field, String nameKey, String documentId) -
getConfig
Description copied from interface:StatisticsFieldReturns the configuration associated with this instance.- Specified by:
getConfigin interfaceStatisticsField- Returns:
- the config; never null.
-
getDisplayName
Description copied from interface:StatisticsFieldGet the display name of this instance- Specified by:
getDisplayNamein interfaceStatisticsField- Parameters:
i18n- the i18n bean- Returns:
- the name; possibly blank
-
isFieldBased
public boolean isFieldBased()- Specified by:
isFieldBasedin interfaceStatisticsField- Returns:
- Does this statistic field use a field
-
getName
-
getField
public com.atlassian.jira.issue.fields.Field getField()Description copied from interface:StatisticsFieldReturns the field that the configuration refers to, if it is still available at this time.- Specified by:
getFieldin interfaceStatisticsField- Returns:
- the field; null if there is no field for the configuration or it is not available.
-
isValid
public boolean isValid()- Specified by:
isValidin interfaceStatisticsField- Returns:
- does this instance refer to a valid configuration?
-
isEnabled
public boolean isEnabled()Description copied from interface:StatisticsFieldNote: this method cannot return true ifStatisticsField.isValid()is false.- Specified by:
isEnabledin interfaceStatisticsField- Returns:
- does this configuration refer to a Statistic for which there is "work to be done".
-
getDocumentId
Description copied from interface:StatisticsFieldNote: behaviour is only determined for this method whenStatisticsField.isValid()is true.- Specified by:
getDocumentIdin interfaceStatisticsField- Returns:
- the ID by which this field is referred to in Lucene documents.
-