Interface SortDataParsingStrategy
- All Known Implementing Classes:
DefaultSortDataParsingStrategy
public interface SortDataParsingStrategy
A Strategy interface to parse the given
SortData from the given Map, so that "ORDER BY" query clause
can be generated dynamically with proper query alias, attribute and sorting direction specified.
Note: This strategy handles sortData's code as lower case to achieve case insensitive behavior for sortCode.
Therefore, key String of sortCodeToQueryAlias should be set as lower case.
-
Method Summary
Modifier and TypeMethodDescriptiongetQueryAlias(Map<String, String> sortCodeToQueryAlias, SortData sortData) getSortCode(Map<String, String> sortCodeToQueryAlias, SortData sortData) Gets the sort code for the given {link SortData} ifMapcontains the sortData.code as key.getSortDirection(Map<String, String> sortCodeToQueryAlias, SortData sortData) Gets the sort direction of the givenSortData
-
Method Details
-
getQueryAlias
- Parameters:
sortCodeToQueryAlias- the map contains mapping between sortData.code and query aliassortData- the sort data- Returns:
- the matching query alias
-
getSortCode
Gets the sort code for the given {link SortData} ifMapcontains the sortData.code as key. Otherwise, returns an empty string.- Parameters:
sortCodeToQueryAlias- the map contains mapping between sortData.code and query aliassortData- the sort data- Returns:
- the sort code
-
getSortDirection
Gets the sort direction of the givenSortData- Parameters:
sortCodeToQueryAlias- the map contains mapping between sortData.code and query aliassortData- the sort data- Returns:
- the sort direction
-