Package com.io7m.idstore.database.postgres.internal

# Class IdAbstractSearch<R extends Q,Q extends IdDatabaseQueriesType,T>

java.lang.Object
com.io7m.idstore.database.postgres.internal.IdAbstractSearch<R,Q,T>

Type Parameters:
  `T` - The type of returned values
  `Q` - The type of queries
  `R` - The (internal) type of queries

All Implemented Interfaces:
  `IdDatabasePagedQueryType<Q,T>`

public abstract class IdAbstractSearch<R extends Q,Q extends IdDatabaseQueriesType,T> extends Object implements IdDatabasePagedQueryType<Q,T>
A convenient abstract class for performing paginated searches.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected abstract IdPage<T>`
  `page(R queries, com.io7m.jqpage.core.JQKeysetRandomAccessPageDefinition page)`
  `protected final int`
  `pageCount()`
  `final IdPage<T>`
  `pageCurrent(Q queries)`
  Get data for the current page.
  `final IdPage<T>`
  `pageNext(Q queries)`
  Get data for the next page.
  `final IdPage<T>`
  `pagePrevious(Q queries)`
  Get data for the previous page.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### pageCount

    protected final int pageCount()

  - ### page

    protected abstract IdPage<T> page(R queries, com.io7m.jqpage.core.JQKeysetRandomAccessPageDefinition page) throws IdDatabaseException
    Throws:
      `IdDatabaseException`

  - ### pageCurrent

    public final IdPage<T> pageCurrent(Q queries) throws IdDatabaseException
    Description copied from interface: `IdDatabasePagedQueryType`
    Get data for the current page.
    Specified by:
      `pageCurrent` in interface `IdDatabasePagedQueryType<R extends Q,Q extends IdDatabaseQueriesType>`
    Parameters:
      `queries` - The query interface
    Returns:
      A page of results
    Throws:
      `IdDatabaseException` - On errors

  - ### pageNext

    public final IdPage<T> pageNext(Q queries) throws IdDatabaseException
    Description copied from interface: `IdDatabasePagedQueryType`
    Get data for the next page. If the current page is the last page, the function acts as `IdDatabasePagedQueryType.pageCurrent(IdDatabaseQueriesType)`.
    Specified by:
      `pageNext` in interface `IdDatabasePagedQueryType<R extends Q,Q extends IdDatabaseQueriesType>`
    Parameters:
      `queries` - The query interface
    Returns:
      A page of results
    Throws:
      `IdDatabaseException` - On errors

  - ### pagePrevious

    public final IdPage<T> pagePrevious(Q queries) throws IdDatabaseException
    Description copied from interface: `IdDatabasePagedQueryType`
    Get data for the previous page. If the current page is the first page, the function acts as `IdDatabasePagedQueryType.pageCurrent(IdDatabaseQueriesType)`.
    Specified by:
      `pagePrevious` in interface `IdDatabasePagedQueryType<R extends Q,Q extends IdDatabaseQueriesType>`
    Parameters:
      `queries` - The query interface
    Returns:
      A page of results
    Throws:
      `IdDatabaseException` - On errors