Class Page<T>

java.lang.Object
NTNU.IDATT1002.repository.Page<T>
Type Parameters:
T - The type of data, preferably an entity.
All Implemented Interfaces:
java.lang.Iterable<T>

public class Page<T>
extends java.lang.Object
implements java.lang.Iterable<T>
Provides operations for navigating between pages. A page contains a list of data which type and size are determined by the previous PageRequest before this page was created. The page does not care what type of data it is holding.
  • Constructor Details

    • Page

      public Page​(java.util.List<T> content, PageRequest pageRequest, long total)
      Create a Page holding given content.
      Parameters:
      content - the list of content
      pageRequest - the PageRequest involved in creating this Page
      total - the current total size of data available. The last page number is calculated with this number.
      Throws:
      java.lang.IllegalArgumentException - if total is negative
  • Method Details