Class PaginatedSearchUtils
java.lang.Object
de.hybris.platform.servicelayer.search.paginated.util.PaginatedSearchUtils
Helper class for handling paginated search.
-
Method Summary
Modifier and TypeMethodDescriptionstatic PaginationDatacreatePaginationData(int pageSize, int currentPage, boolean needsTotal) Creates a new instance ofPaginationDatawith specified pagination informationstatic <T> SearchPageData<T>createSearchPageDataWithPagination(int pageSize, int currentPage, boolean needsTotal) Creates a new instance ofSearchPageDatawith given paginationData parameters.static <T> SearchPageData<T>createSearchPageDataWithPaginationAndSorting(int pageSize, int currentPage, boolean needsTotal, Map<String, String> sortMap) Creates a new instance ofSearchPageDatawith given paginationData and SortData parameters.static SortDatacreateSortData(String code, boolean asc) Creates a new instance ofSortDatawith specified sort information
-
Method Details
-
createPaginationData
public static PaginationData createPaginationData(int pageSize, int currentPage, boolean needsTotal) Creates a new instance ofPaginationDatawith specified pagination information- Parameters:
pageSize- the pageSizecurrentPage- the currentPageneedsTotal- the needsTotal flag- Returns:
PaginationDatawith given pagination information
-
createSortData
Creates a new instance ofSortDatawith specified sort information- Parameters:
code- the attribute code to be sorted byasc- the flag indicating sort ordering- Returns:
SortDatawith given code and sort order
-
createSearchPageDataWithPagination
public static <T> SearchPageData<T> createSearchPageDataWithPagination(int pageSize, int currentPage, boolean needsTotal) Creates a new instance ofSearchPageDatawith given paginationData parameters.- Type Parameters:
T- the SearchPageData result type- Parameters:
pageSize- the pageSize to be set in thePaginationDatacurrentPage- the currentPage to be set in thePaginationDataneedsTotal- the needsTotal flag to be set in thePaginationData- Returns:
- a new instance of
SearchPageDatawith given paginationData parameters
-
createSearchPageDataWithPaginationAndSorting
public static <T> SearchPageData<T> createSearchPageDataWithPaginationAndSorting(int pageSize, int currentPage, boolean needsTotal, Map<String, String> sortMap) Creates a new instance ofSearchPageDatawith given paginationData and SortData parameters.Please note that this helper method only handles one sort code case.
- Type Parameters:
T- the SearchPageData result type- Parameters:
pageSize- the pageSize to be set in thePaginationDatacurrentPage- the currentPage to be set in thePaginationDataneedsTotal- the needsTotal flag to be set in thePaginationDatasortMap- the map contains sortCode as key and sort ordering as value to generateSortDatalist- Returns:
- a new instance of
SearchPageDatawith given paginationData and SortData parameters
-