Interface AsyncPageFetcher<ResponseT>
-
- Type Parameters:
ResponseT
- Type of Response
public interface AsyncPageFetcher<ResponseT>
Interface to deal with async paginated responses.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
hasNextPage(ResponseT oldPage)
Returns a boolean value indicating if a next page is available.CompletableFuture<ResponseT>
nextPage(ResponseT oldPage)
Method that uses the information in #oldPage and returns a completable future for the next page.
-
-
-
Method Detail
-
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
CompletableFuture<ResponseT> nextPage(ResponseT oldPage)
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
-
-