java.lang.Object
com.github.fabriciofx.cactoos.jdbc.pagination.SqlPage<T>
Type Parameters:
T - Type of the page's content
All Implemented Interfaces:
Page<T>

public final class SqlPage<T> extends Object implements Page<T>
SqlPage.

There is no thread-safety guarantee.

Since:
0.8.0
  • Constructor Details

    • SqlPage

      public SqlPage(Session session, Adapter<T> adapter, Query all, int size, int limit, int number)
      Ctor.
      Parameters:
      session - A session
      adapter - An adapter
      all - A query tha retrieve all elements
      size - Amount of elements in this page
      limit - The maximum amount of elements per page
      number - The page number
  • Method Details

    • content

      public List<T> content()
      Description copied from interface: Page
      Get the content of this page.
      Specified by:
      content in interface Page<T>
      Returns:
      A content's list
    • hasNext

      public boolean hasNext()
      Description copied from interface: Page
      Check if there is a next page.
      Specified by:
      hasNext in interface Page<T>
      Returns:
      True if contains or false if it doesn't
    • next

      public Page<T> next()
      Description copied from interface: Page
      Get the next page.
      Specified by:
      next in interface Page<T>
      Returns:
      The next page
    • hasPrevious

      public boolean hasPrevious()
      Description copied from interface: Page
      Check if there is a previous page.
      Specified by:
      hasPrevious in interface Page<T>
      Returns:
      True if contains or false if it doesn't
    • previous

      public Page<T> previous()
      Description copied from interface: Page
      Get the previous page.
      Specified by:
      previous in interface Page<T>
      Returns:
      The previous page