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 StatisticsFieldInstance
forJiraField
(StatisticsFieldConfig config, com.atlassian.jira.issue.fields.Field field) static StatisticsFieldInstance
forJiraFieldWithName
(StatisticsFieldConfig config, com.atlassian.jira.issue.fields.Field field, String nameKey) static StatisticsFieldInstance
forJiraFieldWithNameWithDocumentId
(StatisticsFieldConfig config, com.atlassian.jira.issue.fields.Field field, String nameKey, String documentId) static StatisticsFieldInstance
forNonField
(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.Field
getField()
Returns the field that the configuration refers to, if it is still available at this time.boolean
Note: this method cannot return true ifStatisticsField.isValid()
is false.boolean
boolean
isValid()
-
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:StatisticsField
Returns the configuration associated with this instance.- Specified by:
getConfig
in interfaceStatisticsField
- Returns:
- the config; never null.
-
getDisplayName
Description copied from interface:StatisticsField
Get the display name of this instance- Specified by:
getDisplayName
in interfaceStatisticsField
- Parameters:
i18n
- the i18n bean- Returns:
- the name; possibly blank
-
isFieldBased
public boolean isFieldBased()- Specified by:
isFieldBased
in interfaceStatisticsField
- Returns:
- Does this statistic field use a field
-
getName
-
getField
public com.atlassian.jira.issue.fields.Field getField()Description copied from interface:StatisticsField
Returns the field that the configuration refers to, if it is still available at this time.- Specified by:
getField
in interfaceStatisticsField
- Returns:
- the field; null if there is no field for the configuration or it is not available.
-
isValid
public boolean isValid()- Specified by:
isValid
in interfaceStatisticsField
- Returns:
- does this instance refer to a valid configuration?
-
isEnabled
public boolean isEnabled()Description copied from interface:StatisticsField
Note: this method cannot return true ifStatisticsField.isValid()
is false.- Specified by:
isEnabled
in interfaceStatisticsField
- Returns:
- does this configuration refer to a Statistic for which there is "work to be done".
-
getDocumentId
Description copied from interface:StatisticsField
Note: behaviour is only determined for this method whenStatisticsField.isValid()
is true.- Specified by:
getDocumentId
in interfaceStatisticsField
- Returns:
- the ID by which this field is referred to in Lucene documents.
-