Class PaginatedSearchUtils
- java.lang.Object
-
- de.hybris.platform.servicelayer.search.paginated.util.PaginatedSearchUtils
-
public final class PaginatedSearchUtils extends java.lang.ObjectHelper class for handling paginated search.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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, java.util.Map<java.lang.String,java.lang.String> sortMap)Creates a new instance ofSearchPageDatawith given paginationData and SortData parameters.static SortDatacreateSortData(java.lang.String code, boolean asc)Creates a new instance ofSortDatawith specified sort information
-
-
-
Method Detail
-
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
public static SortData createSortData(java.lang.String code, boolean asc)
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, java.util.Map<java.lang.String,java.lang.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
-
-