T - The type of value contained in this IterableStream.public class PagedIterable<T> extends PagedIterableBase<T,PagedResponse<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 |
|---|---|
<S> PagedIterable<S> |
mapPage(Function<T,S> mapper)
Maps this PagedIterable instance of T to a PagedIterable instance of type S as per the provided mapper function.
|
iterableByPage, iterableByPage, streamByPage, streamByPageiterator, streamclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic <S> PagedIterable<S> mapPage(Function<T,S> mapper)
S - The mapped type.mapper - The mapper function to convert from type T to type S.Copyright © 2019 Microsoft Corporation. All rights reserved.