Class AbstractPagedResult<T>

    • Field Detail

      • DEFAULT_SUPPORT_VIRTUAL_PAGING

        public static final boolean DEFAULT_SUPPORT_VIRTUAL_PAGING
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractPagedResult

        protected AbstractPagedResult()
      • AbstractPagedResult

        protected AbstractPagedResult​(int perPage,
                                      long elementCount,
                                      int currentPage,
                                      int pageCount,
                                      List<T> pageElements)
    • Method Detail

      • getOffset

        public Integer getOffset()
        Description copied from interface: PagedResult

        The position of the first element of the current pages ( (currentPage-1) * perPage )

        Specified by:
        getOffset in interface PagedResult<T>
        Returns:
        offset of the first element in this page
      • getPerPage

        public Integer getPerPage()
        Description copied from interface: PagedResult

        Maximum number of elements in a page

        Specified by:
        getPerPage in interface PagedResult<T>
        Returns:
        maximum number of elements in a page
      • getElementCount

        public Long getElementCount()
        Description copied from interface: PagedResult

        Total number of elements in all pages

        Specified by:
        getElementCount in interface PagedResult<T>
        Returns:
        total number of elements in all pages
      • getCurrentPage

        public Integer getCurrentPage()
        Description copied from interface: PagedResult

        Position of current page ( in the range 1 - n )

        Specified by:
        getCurrentPage in interface PagedResult<T>
        Returns:
        position of current page
      • getCurrentPageSize

        public Integer getCurrentPageSize()
        Description copied from interface: PagedResult

        Number of elements in current page

        Specified by:
        getCurrentPageSize in interface PagedResult<T>
        Returns:
        the size of the current page
      • getPageElementsList

        public List<T> getPageElementsList()
        Description copied from interface: PagedResult

        Elements in the current page

        Specified by:
        getPageElementsList in interface PagedResult<T>
        Returns:
        elements in the current page
      • isLastPage

        public boolean isLastPage()
        Description copied from interface: PagedResult
        true if this is the last page.
        Specified by:
        isLastPage in interface PagedResult<T>
        Returns:
        true if it's the last page
      • isFirstPage

        public boolean isFirstPage()
        Description copied from interface: PagedResult
        true if this is the last page.
        Specified by:
        isFirstPage in interface PagedResult<T>
        Returns:
        true if it's the first page