Class Pagination<O,I>

java.lang.Object
com.ibm.cloud.cloudant.features.pagination.Pagination<O,I>
Type Parameters:
O - the type of the options object used to configure the operation.
I - the reslt row type of the operation.

public class Pagination<O,I> extends Object
Pagination is the entry point for pagination features. Use the static methods to create new Pagination instances. The instances in turn can be used to create:
  • Method Details

    • pager

      public Pager<I> pager()
      Get a new IBM Cloud SDK style Pager for the operation. This type is useful for retrieving one page at a time from a method call.
      Returns:
      a new IBM Cloud SDK style Pager
    • pages

      public Iterable<List<I>> pages()
      Get an Iterable for all the pages. This method is useful for handling pages in an enhanced for loop e.g. for (List<AllDocsResultRow> page : Pagination.newPagination(client, allDocsOptions).pages()) { }
      Returns:
      an Iterable over all the pages
    • pageStream

      public Stream<List<I>> pageStream()
      Get a page by page stream of all the pages.
      Returns:
      a Stream of all the pages
    • rows

      public Iterable<I> rows()
      Get an Iterable for all the rows from all the pages. This type is useful for handling rows in an enhanced for loop e.g. for (AllDocsResultRow row : Pagination.newPagination(client, allDocsOptions).rows()) { }
      Returns:
      an Iterable over all the result rows
    • rowStream

      public Stream<I> rowStream()
      Get a row by row stream of all the rows from all the pages.
      Returns:
      a Stream of all the result rows
    • newPagination

      public static Pagination<PostAllDocsOptions,DocsResultRow> newPagination(Cloudant client, PostAllDocsOptions options)
      Get a Pagination for the postAllDocs operation. The page size is configured with the limit paramater of the options.
      Parameters:
      client - com.ibm.cloud.cloudant.v1.Cloudant instance to make page requests
      options - com.ibm.cloud.cloudant.v1.model.PostAllDocsOptions for the query
      Returns:
      a Pagination for all the documents in the database
    • newPagination

      Get a Pagination for the postPartitionAllDocs operation. The page size is configured with the limit paramater of the options.
      Parameters:
      client - com.ibm.cloud.cloudant.v1.Cloudant instance to make page requests
      options - com.ibm.cloud.cloudant.v1.model.PostPartitionAllDocsOptions for the query
      Returns:
      a Pagination for all the documents in a database partition
    • newPagination

      public static Pagination<PostDesignDocsOptions,DocsResultRow> newPagination(Cloudant client, PostDesignDocsOptions options)
      Get a Pagination for the postPartitionAllDocs operation. The page size is configured with the limit paramater of the options.
      Parameters:
      client - com.ibm.cloud.cloudant.v1.Cloudant instance to make page requests
      options - com.ibm.cloud.cloudant.v1.model.PostPartitionAllDocsOptions for the query
      Returns:
      a Pagination for all the documents in a database partition
    • newPagination

      public static Pagination<PostFindOptions,Document> newPagination(Cloudant client, PostFindOptions options)
      Get a Pagination for the postFind operation. The page size is configured with the limit paramater of the options.
      Parameters:
      client - com.ibm.cloud.cloudant.v1.Cloudant instance to make page requests
      options - com.ibm.cloud.cloudant.v1.model.PostFindOptions for the query
      Returns:
      a Pagination for the result of a find query
    • newPagination

      public static Pagination<PostPartitionFindOptions,Document> newPagination(Cloudant client, PostPartitionFindOptions options)
      Get a Pagination for the postPartitionFind operation.
      Parameters:
      client - com.ibm.cloud.cloudant.v1.Cloudant instance to make page requests
      options - com.ibm.cloud.cloudant.v1.model.PostPartitionFindOptions for the query
      Returns:
      a Pagination for the result of a partition find query
    • newPagination

      public static Pagination<PostSearchOptions,SearchResultRow> newPagination(Cloudant client, PostSearchOptions options)
      Get a Pagination for the postSearch operation. The page size is configured with the limit paramater of the options.
      Parameters:
      client - com.ibm.cloud.cloudant.v1.Cloudant instance to make page requests
      options - com.ibm.cloud.cloudant.v1.model.PostSearchOptions for the query
      Returns:
      a Pagination for the result of a search query
    • newPagination

      Get a Pagination for the postPartitionSearch operation. The page size is configured with the limit paramater of the options.
      Parameters:
      client - com.ibm.cloud.cloudant.v1.Cloudant instance to make page requests
      options - com.ibm.cloud.cloudant.v1.model.PostPartitionSearchOptions for the query
      Returns:
      a Pagination for the result of a partition search query
    • newPagination

      public static Pagination<PostViewOptions,ViewResultRow> newPagination(Cloudant client, PostViewOptions options)
      Get a Pagination for the postView operation. The page size is configured with the limit paramater of the options.
      Parameters:
      client - com.ibm.cloud.cloudant.v1.Cloudant instance to make page requests
      options - com.ibm.cloud.cloudant.v1.model.PostViewOptions for the query
      Returns:
      a Pagination for the result of a view query
    • newPagination

      public static Pagination<PostPartitionViewOptions,ViewResultRow> newPagination(Cloudant client, PostPartitionViewOptions options)
      Get a Pagination for the postPartitionView operation. The page size is configured with the limit paramater of the options.
      Parameters:
      client - com.ibm.cloud.cloudant.v1.Cloudant instance to make page requests
      options - com.ibm.cloud.cloudant.v1.model.PostPartitionViewOptions for the query
      Returns:
      a Pagination for the result of a partition view query