Class PageImpl<T>

    • Constructor Detail

      • PageImpl

        public PageImpl​(int number,
                        int size,
                        SortingData sortingData,
                        java.util.List<T> content,
                        long totalElements)
        Constructor.
        Parameters:
        number - Number of slice.
        size - Slice size.
        sortingData - The SortingData that was used to sort contents of this slice.
        content - Content in this slice.
        totalElements - The overall amount of elements.
    • Method Detail

      • totalPages

        public int totalPages()
        Specified by:
        totalPages in interface Page<T>
        Returns:
        The total amount of pages.
      • totalElements

        public long totalElements()
        Specified by:
        totalElements in interface Page<T>
        Returns:
        The overall amount of elements.
      • hasNext

        public boolean hasNext()
        Description copied from interface: Slice
        Indicates whether this is the last slice.
        Specified by:
        hasNext in interface Slice<T>
        Returns:
        true if it is the last slice, or false otherwise.
      • map

        public <U> Page<U> map​(java.util.function.Function<T,​U> mapper)
        Description copied from interface: Page
        Maps the content of this page according to the given mapper.
        Specified by:
        map in interface Page<T>
        Specified by:
        map in interface Slice<T>
        Type Parameters:
        U - Concrete type of the resulting contents.
        Parameters:
        mapper - A Function that maps the contents of this page.
        Returns:
        A new page containing the mapped elements.