Class ProjectStatisticsMapper
java.lang.Object
com.atlassian.jira.issue.statistics.ProjectStatisticsMapper
- All Implemented Interfaces:
LuceneFieldSorter<Project>,SearchRequestAppender.Factory<Project>,StatisticsMapper<Project>
- Direct Known Subclasses:
CustomFieldProjectStatisticsMapper
public class ProjectStatisticsMapper
extends Object
implements StatisticsMapper<Project>, SearchRequestAppender.Factory<Project>
-
Constructor Summary
ConstructorsConstructorDescriptionProjectStatisticsMapper(ProjectManager projectManager) ProjectStatisticsMapper(ProjectManager projectManager, SimpleFieldSearchConstants searchConstants) ProjectStatisticsMapper(ProjectManager projectManager, String clauseName, String documentConstant) -
Method Summary
Modifier and TypeMethodDescriptionbooleanAs this object is used as a key in a cache, this method must be provided and respect all internal state.protected StringA comparator that can be used to order objects returned byLuceneFieldSorter.getValueFromLuceneField(String).Get the constant that this field is indexed with.getSearchUrlSuffix(Project value, SearchRequest searchRequest) Deprecated.Use #getSearchRequestAppender().appendInclusiveSingleValueClause()getValueFromLuceneField(String documentValue) Convert the lucene document field back to the object that you wish to use to display it.inthashCode()As this object is used as a key in a cache, this method must be provided and respect all internal state.booleanCheck if the field is always part of an issues data.booleanisValidValue(Project value) Check whether this value is valid for this particular search.
-
Constructor Details
-
ProjectStatisticsMapper
-
ProjectStatisticsMapper
public ProjectStatisticsMapper(ProjectManager projectManager, SimpleFieldSearchConstants searchConstants) -
ProjectStatisticsMapper
public ProjectStatisticsMapper(ProjectManager projectManager, String clauseName, String documentConstant)
-
-
Method Details
-
getDocumentConstant
Description copied from interface:LuceneFieldSorterGet the constant that this field is indexed with.- Specified by:
getDocumentConstantin interfaceLuceneFieldSorter<Project>- See Also:
-
getValueFromLuceneField
Description copied from interface:LuceneFieldSorterConvert 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
CustomFieldSearcherModuleDescriptor.getStatHtml(com.atlassian.jira.issue.fields.CustomField, Object, String)- Specified by:
getValueFromLuceneFieldin interfaceLuceneFieldSorter<Project>- Parameters:
documentValue- The value of the field in the lucene index- Returns:
- The value that will be passed to the display
-
getComparator
Description copied from interface:LuceneFieldSorterA comparator that can be used to order objects returned byLuceneFieldSorter.getValueFromLuceneField(String).The Comparator must be reentrant as it could be used by Lucene from multiple threads at once.
- Specified by:
getComparatorin interfaceLuceneFieldSorter<Project>
-
isValidValue
Description copied from interface:StatisticsMapperCheck 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)- Specified by:
isValidValuein interfaceStatisticsMapper<Project>- Parameters:
value- This is the same value that will be returned fromLuceneFieldSorter.getValueFromLuceneField(String)- Returns:
- true if this value is valid for this particular search
-
isFieldAlwaysPartOfAnIssue
public boolean isFieldAlwaysPartOfAnIssue()Description copied from interface:StatisticsMapperCheck 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.- Specified by:
isFieldAlwaysPartOfAnIssuein interfaceStatisticsMapper<Project>- Returns:
- true if this mapper will always be part of an issues data
-
getSearchUrlSuffix
Deprecated.Use #getSearchRequestAppender().appendInclusiveSingleValueClause()Description copied from interface:StatisticsMapperGet 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=10240Note that values returned from implementations should return values that are URLEncoded.
- Specified by:
getSearchUrlSuffixin interfaceStatisticsMapper<Project>- Parameters:
value- This is the same value that will be returned fromLuceneFieldSorter.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:
-
getSearchRequestAppender
- Specified by:
getSearchRequestAppenderin interfaceSearchRequestAppender.Factory<Project>- Since:
- v6.0
-
getClauseName
-
equals
Description copied from interface:LuceneFieldSorterAs this object is used as a key in a cache, this method must be provided and respect all internal state.See the class javadoc entry for more details.
- Specified by:
equalsin interfaceLuceneFieldSorter<Project>- Overrides:
equalsin classObject
-
hashCode
public int hashCode()Description copied from interface:LuceneFieldSorterAs this object is used as a key in a cache, this method must be provided and respect all internal state.See the class javadoc entry for more details.
- Specified by:
hashCodein interfaceLuceneFieldSorter<Project>- Overrides:
hashCodein classObject
-