T - The type of value contained in this IterableResponse.public class PagedIterable<T> extends IterableResponse<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.headers(),
resp.request().url(), resp.statusCode());
resp.items().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.headers(),
resp.request().url(), resp.statusCode());
resp.items().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.headers(), resp.request().url(), resp.statusCode()); resp.items().forEach(value -> {System.out.printf("Response value is %d %n", value); }); }
PagedResponse,
IterableResponse| 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. |
Stream<PagedResponse<T>> |
streamByPage()
Retrieve the
Stream, one page at a time. |
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 Iterable<PagedResponse<T>> iterableByPage()
Iterable API for{ @link PagedResponse}
It will provide same collection of T values from starting if called multiple times.Iterable interfaceCopyright © 2019 Microsoft Corporation. All rights reserved.