Class PaginatedSearchUtils
- java.lang.Object
-
- de.hybris.platform.servicelayer.search.paginated.util.PaginatedSearchUtils
-
public final class PaginatedSearchUtils extends java.lang.Object
Helper class for handling paginated search.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PaginationData
createPaginationData(int pageSize, int currentPage, boolean needsTotal)
Creates a new instance ofPaginationData
with specified pagination informationstatic <T> SearchPageData<T>
createSearchPageDataWithPagination(int pageSize, int currentPage, boolean needsTotal)
Creates a new instance ofSearchPageData
with given paginationData parameters.static <T> SearchPageData<T>
createSearchPageDataWithPaginationAndSorting(int pageSize, int currentPage, boolean needsTotal, java.util.Map<java.lang.String,java.lang.String> sortMap)
Creates a new instance ofSearchPageData
with given paginationData and SortData parameters.static SortData
createSortData(java.lang.String code, boolean asc)
Creates a new instance ofSortData
with specified sort information
-
-
-
Method Detail
-
createPaginationData
public static PaginationData createPaginationData(int pageSize, int currentPage, boolean needsTotal)
Creates a new instance ofPaginationData
with specified pagination information- Parameters:
pageSize
- the pageSizecurrentPage
- the currentPageneedsTotal
- the needsTotal flag- Returns:
PaginationData
with given pagination information
-
createSortData
public static SortData createSortData(java.lang.String code, boolean asc)
Creates a new instance ofSortData
with specified sort information- Parameters:
code
- the attribute code to be sorted byasc
- the flag indicating sort ordering- Returns:
SortData
with given code and sort order
-
createSearchPageDataWithPagination
public static <T> SearchPageData<T> createSearchPageDataWithPagination(int pageSize, int currentPage, boolean needsTotal)
Creates a new instance ofSearchPageData
with given paginationData parameters.- Type Parameters:
T
- the SearchPageData result type- Parameters:
pageSize
- the pageSize to be set in thePaginationData
currentPage
- the currentPage to be set in thePaginationData
needsTotal
- the needsTotal flag to be set in thePaginationData
- Returns:
- a new instance of
SearchPageData
with given paginationData parameters
-
createSearchPageDataWithPaginationAndSorting
public static <T> SearchPageData<T> createSearchPageDataWithPaginationAndSorting(int pageSize, int currentPage, boolean needsTotal, java.util.Map<java.lang.String,java.lang.String> sortMap)
Creates a new instance ofSearchPageData
with 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 thePaginationData
currentPage
- the currentPage to be set in thePaginationData
needsTotal
- the needsTotal flag to be set in thePaginationData
sortMap
- the map contains sortCode as key and sort ordering as value to generateSortData
list- Returns:
- a new instance of
SearchPageData
with given paginationData and SortData parameters
-
-