Class MockNavigableField
- All Implemented Interfaces:
Field,NavigableField,Comparable
- Since:
- v4.0
-
Field Summary
Fields inherited from interface com.atlassian.jira.issue.fields.NavigableField
ORDER_ASCENDING, ORDER_DESCENDING, TEMPLATE_DIRECTORY_PATH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleangetColumnViewHtml(FieldLayoutItem fieldLayoutItem, Map displayParams, Issue issue) The order in which to sort the field when it is sorted for the first time.Returns the id of the field to check for visibility.getId()The unique id of the fieldgetName()Returns i18n'ed name of the field.The i18n key that is used to lookup the field's name when it is displayedorg.apache.lucene.search.FieldComparatorSourceA sortComparatorSource object to be used for sorting columns in a table.A sorter to be used when sorting columns in a table.List<org.apache.lucene.search.SortField>getSortFields(boolean sortOrder) Return a list of Lucene SortFields to be used for sorting search results.inthashCode()prettyPrintChangeHistory(String changeHistory) prettyPrintChangeHistory(String changeHistory, I18nHelper i18nHelper) Used for email notification templates - allows changelog to be displayed in language of the recipient.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.jira.issue.fields.NavigableField
getFieldSorts, getValueLoader, hasSortsDefined, prettyPrintChangeHistory
-
Constructor Details
-
MockNavigableField
-
-
Method Details
-
getId
Description copied from interface:FieldThe unique id of the field -
getColumnHeadingKey
- Specified by:
getColumnHeadingKeyin interfaceNavigableField
-
getColumnCssClass
- Specified by:
getColumnCssClassin interfaceNavigableField
-
getDefaultSortOrder
Description copied from interface:NavigableFieldThe order in which to sort the field when it is sorted for the first time.- Specified by:
getDefaultSortOrderin interfaceNavigableField- Returns:
- Either
NavigableField.ORDER_ASCENDINGorNavigableField.ORDER_DESCENDING
-
getSortComparatorSource
public org.apache.lucene.search.FieldComparatorSource getSortComparatorSource()Description copied from interface:NavigableFieldA sortComparatorSource object to be used for sorting columns in a table. In most cases this will use aMappedSortComparatorusing theNavigableField.getSorter()method. However, fields can provide any sorting mechanism that they wish.If a field can be sorted directly using terms in the Lucene index then the field should implement
NavigableField.getSortFields(boolean sortOrder)rather than this method.In large installations custom sorting may incur a major performance penalty.
- Specified by:
getSortComparatorSourcein interfaceNavigableField- Returns:
- A SortComparatorSource that can be used to sort, or null if this field does not use custom sorting
-
getSortFields
Description copied from interface:NavigableFieldReturn a list of Lucene SortFields to be used for sorting search results.Using this method allows the field to specify the most performant way to perform a search. If a field can be sorted directly using the term in the index then this should just return a singleton list with the sort field.
return Collections.singletonList(new SortField(fieldName, sortOrder));
The default implementation builds this using the FieldComparatorSource returned by
NavigableField.getSortComparatorSource()If you implement this method there is no need to implement
NavigableField.getSortComparatorSource().- Specified by:
getSortFieldsin interfaceNavigableField- Returns:
- The name of the indexed term to be used for native Lucene sorting.
-
getSorter
Description copied from interface:NavigableFieldA sorter to be used when sorting columns in a table. This sort uses the Lucene Document Collection and is therefore a lot faster than sorting the issues in memory.- Specified by:
getSorterin interfaceNavigableField- Returns:
- A sorter that can be used to sort this field, or null depending on the value of
NavigableField.getSortComparatorSource() - See Also:
-
getColumnViewHtml
- Specified by:
getColumnViewHtmlin interfaceNavigableField
-
getHiddenFieldId
Description copied from interface:NavigableFieldReturns the id of the field to check for visibility. For example, with original estimate field need to ensure that the timetracking field is not hidden. With most fields, this is the same as their id.- Specified by:
getHiddenFieldIdin interfaceNavigableField
-
prettyPrintChangeHistory
- Specified by:
prettyPrintChangeHistoryin interfaceNavigableField
-
prettyPrintChangeHistory
Description copied from interface:NavigableFieldUsed for email notification templates - allows changelog to be displayed in language of the recipient.- Specified by:
prettyPrintChangeHistoryin interfaceNavigableField- Parameters:
changeHistory- - label- Returns:
- String change history formatted according to locale in i18nHelper
-
getNameKey
Description copied from interface:FieldThe i18n key that is used to lookup the field's name when it is displayed- Specified by:
getNameKeyin interfaceField
-
getName
Description copied from interface:FieldReturns i18n'ed name of the field. -
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable
-