Class PageUtils
java.lang.Object
es.kukenan.smartfi.microservice.smartficore.util.PageUtils
Page utilities for pagination search.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static intDefault page size in paginated request where page size is not specified.private static final StringError message for ian invalid sorting criteria specification. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.data.domain.PageRequestCreate aPageableinstance from the given paging specification.static org.springframework.data.domain.SortCreate aSortinstance from the given sorting specification.
-
Field Details
-
SORT_ERROR
Error message for ian invalid sorting criteria specification.- See Also:
-
defaultPageSize
@Value("${query.pagination.pageSize.default}") private static int defaultPageSizeDefault page size in paginated request where page size is not specified.
-
-
Constructor Details
-
PageUtils
public PageUtils()
-
-
Method Details
-
sortedBy
Create aSortinstance from the given sorting specification.- Parameters:
sortedByClause- the sorting specification.- Returns:
- the
Sortinstance from the given sorting specification.
-
page
public static org.springframework.data.domain.PageRequest page(Integer pageNumber, Integer pageSize, org.springframework.data.domain.Sort sort) Create aPageableinstance from the given paging specification.- Parameters:
pageNumber- page number, optional default 0.pageSize- page size, optional defaultdefaultPageSize.sort- sorting, optional.- Returns:
- the page request for the given paging specification.
-