public class

DatePeriodStatisticsMapper

extends Object
implements SearchRequestAppender.Factory<T> StatisticsMapper<T>
java.lang.Object
   ↳ com.atlassian.jira.issue.statistics.DatePeriodStatisticsMapper

Class Overview

A StatsMapper that takes the document constant name (lucene) and a JFreeChart TimePeriod class, and rounds the dates to the appropriate time period

See Also
  • org.jfree.data.time.TimePeriod

Summary

Public Constructors
DatePeriodStatisticsMapper(Class timePeriodClass, String documentConstant, TimeZone periodTimeZone)
Creates a new DatePeriodStatisticsMapper using the given time zone.
Public Methods
Comparator<TimePeriod> getComparator()
A comparator that can be used to order objects returned by getValueFromLuceneField(String).
String getDocumentConstant()
Get the constant that this field is indexed with.
SearchRequestAppender<TimePeriod> getSearchRequestAppender()
@Deprecated SearchRequest getSearchUrlSuffix(TimePeriod timePeriod, SearchRequest searchRequest)
This method is deprecated. Use #getSearchRequestAppender().appendInclusiveSingleValueClause()
TimePeriod getValueFromLuceneField(String documentValue)
Convert the lucene document field back to the object that you wish to use to display it.
boolean isFieldAlwaysPartOfAnIssue()
Check if the field is always part of an issues data.
boolean isValidValue(TimePeriod value)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.issue.search.LuceneFieldSorter
From interface com.atlassian.jira.issue.search.SearchRequestAppender.Factory
From interface com.atlassian.jira.issue.statistics.StatisticsMapper

Public Constructors

public DatePeriodStatisticsMapper (Class timePeriodClass, String documentConstant, TimeZone periodTimeZone)

Creates a new DatePeriodStatisticsMapper using the given time zone.

Public Methods

public Comparator<TimePeriod> getComparator ()

A comparator that can be used to order objects returned by getValueFromLuceneField(String).

The Comparator must be reentrant as it could be used by Lucene from multiple threads at once.

public String getDocumentConstant ()

Get the constant that this field is indexed with.

public SearchRequestAppender<TimePeriod> getSearchRequestAppender ()

@Deprecated public SearchRequest getSearchUrlSuffix (TimePeriod timePeriod, SearchRequest searchRequest)

This method is deprecated.
Use #getSearchRequestAppender().appendInclusiveSingleValueClause()

public TimePeriod getValueFromLuceneField (String documentValue)

Convert the lucene document field back to the object that you wish to use to display it.

eg. '1000' -> Version 1.

For custom fields, the return value will be passed to getStatHtml(com.atlassian.jira.issue.fields.CustomField, Object, String)

Parameters
documentValue The value of the field in the lucene index
Returns
  • The value that will be passed to the display

public boolean isFieldAlwaysPartOfAnIssue ()

Check if the field is always part of an issues data. This should only return false in the case of a custom field where the value does not have to be set for each issue.

Returns
  • true if this mapper will always be part of an issues data

public boolean isValidValue (TimePeriod value)