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.getElements().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.getElements().forEach(value -> System.out.printf("Response value is %d %n", value)); });
Code sample using Iterable
by page and while loop
// iterate over each page for (PagedResponse<Integer> resp : pagedIterableResponse.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 %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, iterableByPage, iterableByPage, iterator, stream, streamByPage, streamByPage, streamByPage, streamByPage
of
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public <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 © 2021 Microsoft Corporation. All rights reserved.