Class PageResponse<T>

  • Type Parameters:
    T - object type listed in page
    All Implemented Interfaces:
    Iterable<T>

    public class PageResponse<T>
    extends ListResponse<T,​PageRequest>
    Container for pagination information. See Spring Data Commons, but more flat design and independent of Spring libraries.
    • Constructor Detail

      • PageResponse

        public PageResponse()
      • PageResponse

        public PageResponse​(List<T> content)
        Creates a new PageResponse with the given content. This will result in the created PageResponse being identical to the entire List.
        Parameters:
        content - must not be null.
      • PageResponse

        public PageResponse​(List<T> content,
                            PageRequest request,
                            long total)
        Constructor of PageResponse with the given content and the given governing PageRequest.
        Parameters:
        content - the content of this page, must not be null.
        request - the paging information, can be null.
        total - the total amount of items available. The total might be adapted considering the length of the content given, if it is going to be the content of the last page. This is in place to mitigate inconsistencies
      • PageResponse

        public PageResponse​(List<T> content,
                            PageRequest request,
                            long total,
                            String executedSearchTerm)
        Constructor of PageResponse with the given content and the given governing PageRequest.
        Parameters:
        content - the content of this page, must not be null.
        request - the paging information, can be null.
        total - the total amount of items available. The total might be adapted considering the length of the content given, if it is going to be the content of the last page. This is in place to mitigate inconsistencies
        executedSearchTerm - search term being effectively used (may bechanged/normalized in comparance to original sent request search term) on server side for some reason