T - The type of value in this Iterable.public class IterableResponse<T> extends Object implements Iterable<T>
Code sample using Stream
// process the stream
myIterableResponse.stream().forEach(resp -> {
if (resp.statusCode() == HttpURLConnection.HTTP_OK) {
System.out.printf("Response headers are %s. Url %s \n", resp.deserializedHeaders(), resp.request().url());
resp.items().forEach(value -> {
System.out.printf("Response value is %d \n", value);
});
}
});
Code sample using Iterator
// Iterate over iteratorIterator<PagedResponseBase<String,Integer>> ite = myIterableResponse.iterator(); while (ite.hasNext()) {PagedResponseBase<String,Integer> resp = ite.next(); if (resp.statusCode() ==HttpURLConnection.HTTP_OK) {System.out.printf("Response headers are %s. Url %s \n", resp.deserializedHeaders(), resp.request().url()); resp.items().forEach(value -> {System.out.printf("Response value is %d \n", value); }); } }
Code sample using Stream and filter
// process the stream myIterableResponse.stream().filter(resp -> resp.statusCode() ==HttpURLConnection.HTTP_OK) .limit(10) .forEach(resp -> {System.out.printf("Response headers are %s. Url %s \n", resp.deserializedHeaders(), resp.request().url()); resp.items().forEach(value -> {System.out.printf("Response value is %d \n", value); }); });
Iterable| Constructor and Description |
|---|
IterableResponse(reactor.core.publisher.Flux<T> flux)
Creates instance given
Flux. |
| Modifier and Type | Method and Description |
|---|---|
Iterator<T> |
iterator()
Utility function to provide
Iterator of value T. |
Stream<T> |
stream()
Utility function to provide
Stream of value T. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic IterableResponse(reactor.core.publisher.Flux<T> flux)
Flux.flux - to iterate overCopyright © 2019 Microsoft Corporation. All rights reserved.