Class PagerImpl

  • All Implemented Interfaces:
    Pager

    public class PagerImpl
    extends Object
    implements Pager
    Implementation of Pager.
    • Field Detail

      • MAXIMUM_PAGE_DISPLAY_COUNT

        public static final int MAXIMUM_PAGE_DISPLAY_COUNT
        The number of pages in results before we cut off display with ellipsis.
        See Also:
        Constant Field Values
      • PAGINATION_RANGE_SIZE

        public static final int PAGINATION_RANGE_SIZE
        The number of possible pages to show around current page before showing ellipsis.
        See Also:
        Constant Field Values
    • Constructor Detail

      • PagerImpl

        public PagerImpl​(Map<String,​String> existingQueryParameters,
                         int totalPages,
                         int currentPageIndex)
    • Method Detail

      • getCurrentPage

        public int getCurrentPage()
        Description copied from interface: Pager
        Get the current page.
        Specified by:
        getCurrentPage in interface Pager
        Returns:
        the current page
      • getTotalPages

        public int getTotalPages()
        Description copied from interface: Pager
        Get the total number of pages.
        Specified by:
        getTotalPages in interface Pager
        Returns:
        the total number of pages
      • getPages

        @Nonnull
        public List<PagerPage> getPages()
        Description copied from interface: Pager
        Get all pagination parameters available for the current result set.
        Specified by:
        getPages in interface Pager
        Returns:
        the pagination parameters
      • getPreviousPageParameters

        @Nonnull
        public Map<String,​String> getPreviousPageParameters()
        Description copied from interface: Pager
        Get the previous page parameters for supporting linking to the previous page.
        Specified by:
        getPreviousPageParameters in interface Pager
        Returns:
        the previous page parameters
      • getNextPageParameters

        @Nonnull
        public Map<String,​String> getNextPageParameters()
        Description copied from interface: Pager
        Get the mext page parameters for supporting linking to the mext page.
        Specified by:
        getNextPageParameters in interface Pager
        Returns:
        the mext page parameters
      • getMorePagesBefore

        public boolean getMorePagesBefore()
        Description copied from interface: Pager
        Whether there are additional pages in pagination set than are displayable currently at the start of the page list.
        Specified by:
        getMorePagesBefore in interface Pager
        Returns:
        true if more pages before current starting page
      • getMorePagesAfter

        public boolean getMorePagesAfter()
        Description copied from interface: Pager
        Whether there are additional pages in pagination set than are displayable currently at the end of the page list.
        Specified by:
        getMorePagesAfter in interface Pager
        Returns:
        true if more pages after current end page