Interface AsyncPageFetcher<ResponseT>

Type Parameters:
ResponseT - Type of Response

public interface AsyncPageFetcher<ResponseT>
Interface to deal with async paginated responses.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns a boolean value indicating if a next page is available.
    Method that uses the information in #oldPage and returns a completable future for the next page.
  • Method Details

    • hasNextPage

      boolean hasNextPage(ResponseT oldPage)
      Returns a boolean value indicating if a next page is available.
      Parameters:
      oldPage - last page sent by service in a paginated operation
      Returns:
      True if there is a next page available. Otherwise false.
    • nextPage

      Method that uses the information in #oldPage and returns a completable future for the next page. This method makes service calls.
      Parameters:
      oldPage - last page sent by service in a paginated operation
      Returns:
      A CompletableFuture that can be used to get the next response page