@PublicSpi public interface

StatisticsMapper

implements LuceneFieldSorter<T>
com.atlassian.jira.issue.statistics.StatisticsMapper<T>
Known Indirect Subclasses

@PublicSpi

This interface is designed for plugins to implement.

Clients of @PublicSpi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicSpi as per each product's API policy (clients should refer to each product's API policy for the exact guarantee -- usually binary compatibility is guaranteed at least across minor versions).

Note: @PublicSpi interfaces and classes are specifically designed to be implemented/extended by clients. Hence, the guarantee of binary compatibility is different to that of @PublicApi elements (if an element is both @PublicApi and @PublicSpi, both guarantees apply).

Class Overview

Allow mapping from Lucene indexes, back to the fields that they came from.

Any 'field' that implements this is capable of having a statistic calculated from it.

Summary

Public Methods
SearchRequest getSearchUrlSuffix(T value, SearchRequest searchRequest)
Get a suffix for the issue navigator, which allows for filtering on this value.
boolean isFieldAlwaysPartOfAnIssue()
Check if the field is always part of an issues data.
boolean isValidValue(T value)
Check whether this value is valid for this particular search.
[Expand]
Inherited Methods
From interface com.atlassian.jira.issue.search.LuceneFieldSorter

Public Methods

public SearchRequest getSearchUrlSuffix (T value, SearchRequest searchRequest)

Get a suffix for the issue navigator, which allows for filtering on this value.

eg. a project field would return a SearchRequest object who's getQueryString method will produce pid=10240

Note that values returned from implementations should return values that are URLEncoded.

Parameters
value This is the same value that will be returned from getValueFromLuceneField(String)
searchRequest is the search request that should be used as the base of the newly generated SearchRequest object. If this parameter is null then the return type will also be null.
Returns
  • a SearchRequest object that will generate the correct issue navigator url to search the correct statistics set, null otherwise.
See Also

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 (T value)

Check whether this value is valid for this particular search. This is useful if you do not wish to display all the values that are indexed (eg - only show released versions)

Parameters
value This is the same value that will be returned from getValueFromLuceneField(String)
Returns
  • true if this value is valid for this particular search