Package org.silverpeas.core.admin
Class PaginationPage
- java.lang.Object
-
- org.silverpeas.core.admin.PaginationPage
-
- All Implemented Interfaces:
Serializable
public class PaginationPage extends Object implements Serializable
A page in a pagination of resources. This bean is dedicated to be used with search criteria and permits also to handle pagination context into UI pages.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static PaginationPage
DEFAULT
-
Constructor Summary
Constructors Constructor Description PaginationPage(int pageNumber, int pageSize)
Constructs a new page in a pagination mechanism.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PaginationCriterion
asCriterion()
Converts the pagination page into aPaginationCriterion
instance which represents the criterion of pagination into the context of persistence.int
getPageNumber()
Gets this page number.int
getPageSize()
Gets the size of this page.<T> SilverpeasList<T>
getPaginatedListFrom(List<T> list)
Gets a paginated list from the given one by applying the pagination page context.
If the list size is lower than the pagination page index, then pagination context is adjusted.PaginationPage
originalSizeIsNotRequired()
Indicates that the caller does not require to useSilverpeasList.originalListSize()
method, so the original size of a result is not necessary.String
toString()
-
-
-
Field Detail
-
DEFAULT
public static final PaginationPage DEFAULT
-
-
Method Detail
-
originalSizeIsNotRequired
public PaginationPage originalSizeIsNotRequired()
Indicates that the caller does not require to useSilverpeasList.originalListSize()
method, so the original size of a result is not necessary.- Returns:
- itself.
-
getPageNumber
public int getPageNumber()
Gets this page number.- Returns:
- the page number.
-
getPageSize
public int getPageSize()
Gets the size of this page.- Returns:
- the count of items being in part of each page.
-
asCriterion
public PaginationCriterion asCriterion()
Converts the pagination page into aPaginationCriterion
instance which represents the criterion of pagination into the context of persistence.- Returns:
- the corresponding
PaginationCriterion
instance.
-
getPaginatedListFrom
public <T> SilverpeasList<T> getPaginatedListFrom(List<T> list)
Gets a paginated list from the given one by applying the pagination page context.
If the list size is lower than the pagination page index, then pagination context is adjusted.- Parameters:
list
- the list to paginate.- Returns:
- the paginated list.
-
-