T
- The type of value contained in this IterableStream
.P
- The response extending from PagedResponse
public class PagedIterableBase<T,P extends PagedResponse<T>> extends ContinuablePagedIterable<String,T,P>
PagedResponse
using Stream
and
Iterable
interfaces.
Code sample using Stream
by page
// process the streamByPage CustomPagedFlux<String> customPagedFlux = createCustomInstance(); PagedIterableBase<String, PagedResponse<String>> customPagedIterableResponse = new PagedIterableBase<>(customPagedFlux); customPagedIterableResponse.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.getElements().forEach(value -> System.out.printf("Response value is %s %n", value)); });
Code sample using Iterable
by page
// process the iterableByPage customPagedIterableResponse.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.getElements().forEach(value -> System.out.printf("Response value is %s %n", value)); });
Code sample using Iterable
by page and while loop
// iterate over each page for (PagedResponse<String> resp : customPagedIterableResponse.iterableByPage()) { System.out.printf("Response headers are %s. Url %s and status code %d %n", resp.getHeaders(), resp.getRequest().getUrl(), resp.getStatusCode()); resp.getElements().forEach(value -> System.out.printf("Response value is %s %n", value)); }
PagedResponse
,
IterableStream
Constructor and Description |
---|
PagedIterableBase(PagedFluxBase<T,P> pagedFluxBase)
Creates instance given
PagedFluxBase . |
iterableByPage, iterableByPage, iterableByPage, iterableByPage, iterator, stream, streamByPage, streamByPage, streamByPage, streamByPage
of
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public PagedIterableBase(PagedFluxBase<T,P> pagedFluxBase)
PagedFluxBase
.pagedFluxBase
- to use as iterableCopyright © 2021 Microsoft Corporation. All rights reserved.