Class PageImpl<T>

    • Constructor Detail

      • PageImpl

        public PageImpl​(List<T> pageItems,
                        int pageSize,
                        int currentPage,
                        Integer totalCount,
                        boolean hasNextPage)
      • PageImpl

        public PageImpl​(List<T> pageItems,
                        int pageSize,
                        int currentPage,
                        Integer totalCount,
                        boolean hasNextPage,
                        boolean partialData)
      • PageImpl

        public PageImpl​(Page<T> copy)
      • PageImpl

        protected PageImpl()
    • Method Detail

      • empty

        public static <T> Page<T> empty()
      • empty

        public static <T> Page<T> empty​(int pageSize,
                                        int currentPage)
      • page

        public static <I,​T> Page<T> page​(T result)
      • transformed

        public static <I,​T> Page<T> transformed​(Page<I> original,
                                                      Function<? super I,​T> transformer)
      • withNextPage

        public static <T> Page<T> withNextPage​(List<T> pageItems,
                                               int pageSize,
                                               int currentPage,
                                               boolean hasNextPage)
      • withTotalCount

        public static <T> Page<T> withTotalCount​(List<T> pageItems,
                                                 int totalCount,
                                                 int pageSize,
                                                 int currentPage)
      • getCurrentPage

        public int getCurrentPage()
        Description copied from interface: Page
        Returns the number of this page within the total
        Specified by:
        getCurrentPage in interface Page<T>
      • getPageCount

        public Integer getPageCount()
        Description copied from interface: Page
        Returns the total number of pages. If the total count is unknown, returns null.
        Specified by:
        getPageCount in interface Page<T>
      • getPageItems

        public List<T> getPageItems()
        Description copied from interface: Page
        Returns the page items
        Specified by:
        getPageItems in interface Page<T>
      • getPageSize

        public int getPageSize()
        Description copied from interface: Page
        Returns the page size
        Specified by:
        getPageSize in interface Page<T>
      • getTotalCount

        public Integer getTotalCount()
        Description copied from interface: Page
        Returns the total number of records. If the total count is unknown, returns null.
        Specified by:
        getTotalCount in interface Page<T>
      • isHasNextPage

        public boolean isHasNextPage()
        Description copied from interface: Page
        Returns whether a next page exists
        Specified by:
        isHasNextPage in interface Page<T>
      • isPartialData

        public boolean isPartialData()
        Description copied from interface: HasPartialData
        Indicates whether only part of the expected data is being returned due to a failure in the backend service (such failing OpenSearch shards).
        Specified by:
        isPartialData in interface HasPartialData
      • setCurrentPage

        public void setCurrentPage​(int currentPage)
      • setHasNextPage

        public void setHasNextPage​(boolean hasNextPage)
      • setPageItems

        public void setPageItems​(List<T> pageItems)
      • setPageSize

        public void setPageSize​(int pageSize)
      • setPartialData

        public void setPartialData​(boolean partialData)
      • setTotalCount

        public void setTotalCount​(Integer totalCount)
      • stream

        public Stream<T> stream()
        Description copied from interface: Page
        Returns a stream with the page items
        Specified by:
        stream in interface Page<T>