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

public final class SqlPages<T> extends Object implements Pages<T>
SqlPages.

There is no thread-safety guarantee.

Since:
0.8.0
  • Constructor Details

    • SqlPages

      public SqlPages(Session session, Query count, Query all, Adapter<T> adapter, int limit)
      Ctor.
      Parameters:
      session - A Session
      count - A query that retrieve the total count of elements.
      all - A query tha retrieve all elements.
      adapter - An adapter
      limit - The maximum amount of elements per page.
  • Method Details

    • count

      public int count()
      Description copied from interface: Pages
      Get the number of pages.
      Specified by:
      count in interface Pages<T>
      Returns:
      The number of pages
    • page

      public Page<T> page(int number)
      Description copied from interface: Pages
      Get a page by the number.
      Specified by:
      page in interface Pages<T>
      Parameters:
      number - The page number
      Returns:
      A page