Interface SearchHelper
-
- All Known Implementing Classes:
DefaultSearchHelper
public interface SearchHelperAn interface for search helper functions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.List<Sort>convertSort(java.lang.String sort, SortDirection defaultSortDirection)Converts the String sort param into a list ofSortobjects.SortconvertSortBlock(java.lang.String sortBlock, SortDirection defaultSortDirection)Convert a sort block, i.e.
-
-
-
Method Detail
-
convertSort
java.util.List<Sort> convertSort(java.lang.String sort, SortDirection defaultSortDirection)
Converts the String sort param into a list ofSortobjects. The input, if not empty, should be already validated with the following format: {param}:{direction} Multiple sort parameters are allowed if the blocks are separated by comma.- Parameters:
sort- - the sort parameter received from the requestdefaultSortDirection- the default sort direction if not supplied in any of the sortBlocks- Returns:
- a list of Sort objects
-
convertSortBlock
Sort convertSortBlock(java.lang.String sortBlock, SortDirection defaultSortDirection)
Convert a sort block, i.e. {param}:{direction} into aSortobject. When a sort direction is invalid or is not provided, the sort direction is defaulted to the defaultSortDirection param.- Parameters:
sortBlock- a colon delimited String containing the sort field name and sorting directiondefaultSortDirection- the default sort direction if not supplied in the sortBlock- Returns:
- a
Sortobject
-
-