com.atlassian.jira.issue.search.util
Class SearchSortUtilImpl
java.lang.Object
com.atlassian.jira.issue.search.util.SearchSortUtilImpl
- All Implemented Interfaces:
- SearchSortUtil
public class SearchSortUtilImpl
- extends java.lang.Object
- implements SearchSortUtil
Method Summary |
java.util.List<SearchSort> |
concatSearchSorts(java.util.Collection<SearchSort> newSorts,
java.util.Collection<SearchSort> oldSorts,
int maxLength)
Concatenate the new search sorts and the old search sorts returning a list of sorts that is only of size maxLength. |
OrderBy |
getOrderByClause(java.util.Map parameterMap)
This method is used to convert incomming, request-style, parameters into SearchSort objects. |
java.util.List<SearchSort> |
getSearchSorts(Query query)
|
java.util.List<SearchSort> |
mergeSearchSorts(com.opensymphony.user.User user,
java.util.Collection<SearchSort> newSorts,
java.util.Collection<SearchSort> oldSorts,
int maxLength)
Combine the new search sorts and the old search sorts returning a list of sorts that is only of size maxLength. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SearchSortUtilImpl
public SearchSortUtilImpl(SearchHandlerManager searchHandlerManager,
FieldManager fieldManager)
concatSearchSorts
public java.util.List<SearchSort> concatSearchSorts(java.util.Collection<SearchSort> newSorts,
java.util.Collection<SearchSort> oldSorts,
int maxLength)
- Description copied from interface:
SearchSortUtil
- Concatenate the new search sorts and the old search sorts returning a list of sorts that is only of size maxLength.
Old sorts will fall off the end of the list first.
- Specified by:
concatSearchSorts
in interface SearchSortUtil
- Parameters:
newSorts
- the new sorts that should go in the front of the sort list; must not be nulloldSorts
- the old sorts that should be in the end of the sort list; may be nullmaxLength
- the max size of the produced list
- Returns:
- a list of search sorts that contains the newest and oldest sorts respecting the max length.
mergeSearchSorts
public java.util.List<SearchSort> mergeSearchSorts(com.opensymphony.user.User user,
java.util.Collection<SearchSort> newSorts,
java.util.Collection<SearchSort> oldSorts,
int maxLength)
- Description copied from interface:
SearchSortUtil
- Combine the new search sorts and the old search sorts returning a list of sorts that is only of size maxLength.
Old sorts will fall off the end of the list first. If there are any sorts that are duplicated (the field is
mentioned again, sort order not taken into account), then the old sort reference will not be mentioned and will
be replaced with the new sort in the correct position in the list.
- Specified by:
mergeSearchSorts
in interface SearchSortUtil
- Parameters:
user
- performing the searchnewSorts
- the new sorts that should go in the front of the sort list; must not be nulloldSorts
- the old sorts that should be in the end of the sort list; may be nullmaxLength
- the max size of the produced list
- Returns:
- a list of search sorts that contains the newest and oldest sorts respecting the max length.
getSearchSorts
public java.util.List<SearchSort> getSearchSorts(Query query)
- Specified by:
getSearchSorts
in interface SearchSortUtil
getOrderByClause
public OrderBy getOrderByClause(java.util.Map parameterMap)
- Description copied from interface:
SearchSortUtil
- This method is used to convert incomming, request-style, parameters into SearchSort objects.
- Specified by:
getOrderByClause
in interface SearchSortUtil
- Parameters:
parameterMap
- contains 0 or many "sorter/order" and "sorter/field" parameters that will
be converted into a search sort. The field is the System/Custom field name and will be converted
by this method into the JQL Primary clause name. The reason for this is that we need to support
"old (pre 4.0)" URL parameters and these contain the field id, not the clause name. Since the
UI is the only thing producing these parameters we decided to leave it generating the field
id. When sorts are specified in JQL they will be in clause names.
- Returns:
- an OrderBy that can be used to populate a
Query
which contains alist
of SearchSort's that relate to the passed in parameters. Will be an order by with empty sorts if there are no
search sorts in the parameters.
Copyright © 2002-2010 Atlassian. All Rights Reserved.