Interface Pagination<T>

Type Parameters:
T - a domain type like User

@Immutable public interface Pagination<T>
A container for a partial list of objects, that are being returned paginated. Has the pagination information needed to get the rest of the objects
  • Method Details

    • getList

      List<T> getList()
    • getPerPage

      int getPerPage()
    • getTotalPages

      int getTotalPages()
    • getNextPage

      @Nullable Integer getNextPage()
      Will be null once we have read the last page available
      Returns:
      either the number of the next page or null if the list has ended
    • getPreviousPage

      @Nullable Integer getPreviousPage()
    • getPage

      int getPage()
    • of

      static <T> Pagination<T> of(PaginatedList paginatedList, List<T> elements)