T - The type of value contained in this IterableStream.public class PagedIterable<T> extends IterableStream<T>
PagedResponse using Stream and Iterable
interfaces.
Code sample using Stream by page
// process the streamByPage
pagedIterableResponse.streamByPage().forEach(resp -> {
System.out.printf("Response headers are %s. Url %s and status code %d %n", resp.getHeaders(),
resp.getRequest().getUrl(), resp.getStatusCode());
resp.getItems().forEach(value -> {
System.out.printf("Response value is %d %n", value);
});
});
Code sample using Iterable by page
// process the iterableByPage
pagedIterableResponse.iterableByPage().forEach(resp -> {
System.out.printf("Response headers are %s. Url %s and status code %d %n", resp.getHeaders(),
resp.getRequest().getUrl(), resp.getStatusCode());
resp.getItems().forEach(value -> {
System.out.printf("Response value is %d %n", value);
});
});
Code sample using Iterable by page and while loop
// iterate over each pageIterator<PagedResponse<Integer>> ite = pagedIterableResponse.iterableByPage().iterator(); while (ite.hasNext()) {PagedResponse<Integer> resp = ite.next();System.out.printf("Response headers are %s. Url %s and status code %d %n", resp.getHeaders(), resp.getRequest().getUrl(), resp.getStatusCode()); resp.getItems().forEach(value -> {System.out.printf("Response value is %d %n", value); }); }
PagedResponse,
IterableStream| Constructor and Description |
|---|
PagedIterable(PagedFlux<T> pagedFlux)
Creates instance given
PagedFlux. |
| Modifier and Type | Method and Description |
|---|---|
Iterable<PagedResponse<T>> |
iterableByPage()
Provides
Iterable API for{ @link PagedResponse}
It will provide same collection of T values from starting if called multiple times. |
Iterable<PagedResponse<T>> |
iterableByPage(String continuationToken)
Provides
Iterable API for PagedResponse, starting from the next page associated with the given
continuation token. |
Stream<PagedResponse<T>> |
streamByPage()
Retrieve the
Stream, one page at a time. |
Stream<PagedResponse<T>> |
streamByPage(String continuationToken)
Retrieve the
Stream, one page at a time, starting from the next page associated with the given
continuation token. |
iterator, streamclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic Stream<PagedResponse<T>> streamByPage()
Stream, one page at a time.
It will provide same Stream of T values from starting if called multiple times.Stream of PagedResponsepublic Stream<PagedResponse<T>> streamByPage(String continuationToken)
Stream, one page at a time, starting from the next page associated with the given
continuation token. To start from first page, use PagedIterable.streamByPage() instead.continuationToken - The continuation token used to fetch the next pageStream of PagedResponse, starting from the page associated with the continuation tokenpublic Iterable<PagedResponse<T>> iterableByPage()
Iterable API for{ @link PagedResponse}
It will provide same collection of T values from starting if called multiple times.Iterable interfacepublic Iterable<PagedResponse<T>> iterableByPage(String continuationToken)
Iterable API for PagedResponse, starting from the next page associated with the given
continuation token. To start from first page, use PagedIterable.streamByPage() instead.
It will provide same collection of T values from starting if called multiple times.continuationToken - The continuation token used to fetch the next pageIterable interfaceCopyright © 2019 Microsoft Corporation. All rights reserved.