T
- The type of items contained in the TextAnalyticsPagedIterable
public final class TextAnalyticsPagedIterable<T> extends IterableStream<T>
PagedResponse
using Stream
and Iterable
interfaces.
Code sample using Stream
pagedIterable.stream().forEach(item -> System
.out.println("Processing item" + item));
Code sample using Stream
by page
pagedIterable.streamByPage().forEach(resp -> { if (resp.getStatusCode() ==HttpURLConnection
.HTTP_OK) {System
.out.printf("Response headers are %s. Url %s%n", resp.getDeserializedHeaders(), resp.getRequest().getUrl()); resp.getElements().forEach(value ->System
.out.printf("Response value is %s%n", value)); } });
Code sample using Iterable
Iterator
<LinkedEntity
> iterator = pagedIterable.iterator(); while (iterator.hasNext()) {System
.out.println("Processing item" + iterator.next()); }
Code sample using Iterable
by page
pagedIterable.iterableByPage().forEach(resp -> { if (resp.getStatusCode() ==HttpURLConnection
.HTTP_OK) {System
.out.printf("Response headers are %s. Url %s%n", resp.getDeserializedHeaders(), resp.getRequest().getUrl()); resp.getElements().forEach(value ->System
.out.printf("Response value is %s%n", value)); } });
IterableStream
Constructor and Description |
---|
TextAnalyticsPagedIterable(TextAnalyticsPagedFlux<T> textAnalyticsPagedFlux)
Creates instance given
TextAnalyticsPagedFlux . |
Modifier and Type | Method and Description |
---|---|
Iterable<TextAnalyticsPagedResponse<T>> |
iterableByPage()
Provides
Iterable API for TextAnalyticsPagedResponse . |
Stream<TextAnalyticsPagedResponse<T>> |
streamByPage()
Retrieve the
Stream , one page at a time, starting from the next page associated with the given
continuation token. |
iterator, of, stream
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public TextAnalyticsPagedIterable(TextAnalyticsPagedFlux<T> textAnalyticsPagedFlux)
TextAnalyticsPagedFlux
.textAnalyticsPagedFlux
- It used as iterable.public Stream<TextAnalyticsPagedResponse<T>> streamByPage()
Stream
, one page at a time, starting from the next page associated with the given
continuation token. To start from first page, use TextAnalyticsPagedIterable.streamByPage()
instead.Stream
of a TextAnalyticsPagedResponse
of T
.public Iterable<TextAnalyticsPagedResponse<T>> iterableByPage()
Iterable
API for TextAnalyticsPagedResponse
.Iterable
of TextAnalyticsPagedResponse
of T
.Copyright © 2020 Microsoft Corporation. All rights reserved.