Class 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
    • Constructor Detail

      • PaginationPage

        public PaginationPage​(int pageNumber,
                              int pageSize)
        Constructs a new page in a pagination mechanism.
        Parameters:
        pageNumber - the number of the page.
        pageSize - the size in items of the page.
    • Method Detail

      • originalSizeIsNotRequired

        public PaginationPage originalSizeIsNotRequired()
        Indicates that the caller does not require to use SilverpeasList.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.
      • 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.