Interface PageResponse<T>

  • Type Parameters:
    T - object type listed in page
    All Superinterfaces:
    Iterable<T>
    All Known Implementing Classes:
    PageResponseImpl

    public interface PageResponse<T>
    extends Iterable<T>
    Abstract interface for pagination information. See Spring Data Commons, but more flat design and independent of Spring libraries. TODO: add Builder, @see PageRequest
    • Method Detail

      • getContent

        List<T> getContent()
        Returns:
        the page content/objects as List.
      • setContent

        void setContent​(List<T> content)
        Allows to set the content (needed in case of content has to be converted/casted)
        Parameters:
        content - list of content/objects of this page
      • getNumber

        int getNumber()
        Returns the number of the current PageResponse. Is always non-negative.
        Returns:
        the number of the current PageResponse.
      • getNumberOfElements

        int getNumberOfElements()
        Returns the number of elements currently on this PageResponse.
        Returns:
        the number of elements currently on this PageResponse.
      • getPageRequest

        PageRequest getPageRequest()
        Returns:
        the PageRequest used to get this PageResponse
      • getTotalElements

        long getTotalElements()
        Returns the total amount of elements.
        Returns:
        the total amount of elements
      • getTotalPages

        int getTotalPages()
        Returns the number of total pages.
        Returns:
        the number of total pages
      • hasContent

        boolean hasContent()
        Returns whether the PageResponse has content at all.
        Returns:
        whether the PageResponse has content at all.
      • hasPrevious

        boolean hasPrevious()
        Returns if there is a previous PageResponse.
        Returns:
        if there is a previous PageResponse.
      • isFirst

        boolean isFirst()
        Returns whether the current PageResponse is the first one.
        Returns:
        whether the current PageResponse is the first one.
      • isLast

        boolean isLast()
        Returns whether the current PageResponse is the last one.
        Returns:
        whether the current PageResponse is the last one.