Package com.azure.core.util.paging
Class ContinuablePagedIterable<C,T,P extends ContinuablePage<C,T>>
- java.lang.Object
-
- com.azure.core.util.IterableStream<T>
-
- com.azure.core.util.paging.ContinuablePagedIterable<C,T,P>
-
- Type Parameters:
C
- the type of the continuation tokenT
- The type of elements in aContinuablePage
P
- TheContinuablePage
holding items of typeT
.
- All Implemented Interfaces:
Iterable<T>
- Direct Known Subclasses:
PagedIterableBase
public abstract class ContinuablePagedIterable<C,T,P extends ContinuablePage<C,T>> extends IterableStream<T>
- See Also:
IterableStream
,ContinuablePagedFlux
-
-
Constructor Summary
Constructors Constructor Description ContinuablePagedIterable(ContinuablePagedFlux<C,T,P> pagedFlux)
Creates instance with the givenContinuablePagedFlux
.ContinuablePagedIterable(ContinuablePagedFlux<C,T,P> pagedFlux, int batchSize)
Creates instance with the givenContinuablePagedFlux
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterable<P>
iterableByPage()
Retrieve theIterable
, one page at a time.Iterable<P>
iterableByPage(int preferredPageSize)
Retrieve theIterable
, one page at a time, with each page containingpreferredPageSize
items.Iterable<P>
iterableByPage(C continuationToken)
Retrieve theIterable
, one page at a time, starting from the next page associated with the given continuation token.Iterable<P>
iterableByPage(C continuationToken, int preferredPageSize)
Retrieve theIterable
, one page at a time, with each page containingpreferredPageSize
items, starting from the next page associated with the given continuation token.Iterator<T>
iterator()
Utility function to provideIterator
of valueT
.Stream<T>
stream()
Utility function to provideStream
of valueT
.Stream<P>
streamByPage()
Retrieve theStream
, one page at a time.Stream<P>
streamByPage(int preferredPageSize)
Retrieve theStream
, one page at a time, with each page containingpreferredPageSize
items.Stream<P>
streamByPage(C continuationToken)
Retrieve theStream
, one page at a time, starting from the next page associated with the given continuation token.Stream<P>
streamByPage(C continuationToken, int preferredPageSize)
Retrieve theStream
, one page at a time, with each page containingpreferredPageSize
items, starting from the next page associated with the given continuation token.-
Methods inherited from class com.azure.core.util.IterableStream
of
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
ContinuablePagedIterable
public ContinuablePagedIterable(ContinuablePagedFlux<C,T,P> pagedFlux)
Creates instance with the givenContinuablePagedFlux
.- Parameters:
pagedFlux
- the paged flux use as iterable
-
ContinuablePagedIterable
public ContinuablePagedIterable(ContinuablePagedFlux<C,T,P> pagedFlux, int batchSize)
Creates instance with the givenContinuablePagedFlux
.- Parameters:
pagedFlux
- the paged flux use as iterablebatchSize
- the bounded capacity to prefetch from theContinuablePagedFlux
-
-
Method Detail
-
stream
public Stream<T> stream()
Description copied from class:IterableStream
Utility function to provideStream
of valueT
.- Overrides:
stream
in classIterableStream<T>
- Returns:
Stream
of valueT
.
-
streamByPage
public Stream<P> streamByPage()
Retrieve theStream
, one page at a time. It will provide sameStream
of T values from starting if called multiple times.- Returns:
Stream
of a pages
-
streamByPage
public Stream<P> streamByPage(C continuationToken)
Retrieve theStream
, one page at a time, starting from the next page associated with the given continuation token. To start from first page, usestreamByPage()
instead.- Parameters:
continuationToken
- The continuation token used to fetch the next page- Returns:
Stream
of a pages
-
streamByPage
public Stream<P> streamByPage(int preferredPageSize)
Retrieve theStream
, one page at a time, with each page containingpreferredPageSize
items. It will provide sameStream
of T values from starting if called multiple times.- Parameters:
preferredPageSize
- the preferred page size, service may or may not honor the page size preference hence client MUST be prepared to handle pages with different page size.- Returns:
Stream
of a pages
-
streamByPage
public Stream<P> streamByPage(C continuationToken, int preferredPageSize)
Retrieve theStream
, one page at a time, with each page containingpreferredPageSize
items, starting from the next page associated with the given continuation token. To start from first page, usestreamByPage()
orstreamByPage(int)
instead.- Parameters:
preferredPageSize
- the preferred page size, service may or may not honor the page size preference hence client MUST be prepared to handle pages with different page size.continuationToken
- The continuation token used to fetch the next page- Returns:
Stream
of a pages
-
iterator
public Iterator<T> iterator()
Description copied from class:IterableStream
Utility function to provideIterator
of valueT
.
-
iterableByPage
public Iterable<P> iterableByPage()
Retrieve theIterable
, one page at a time. It will provide sameIterable
of T values from starting if called multiple times.- Returns:
Stream
of a pages
-
iterableByPage
public Iterable<P> iterableByPage(C continuationToken)
Retrieve theIterable
, one page at a time, starting from the next page associated with the given continuation token. To start from first page, useiterableByPage()
instead.- Parameters:
continuationToken
- The continuation token used to fetch the next page- Returns:
Iterable
of a pages
-
iterableByPage
public Iterable<P> iterableByPage(int preferredPageSize)
Retrieve theIterable
, one page at a time, with each page containingpreferredPageSize
items. It will provide sameIterable
of T values from starting if called multiple times.- Parameters:
preferredPageSize
- the preferred page size, service may or may not honor the page size preference hence client MUST be prepared to handle pages with different page size.- Returns:
Iterable
of a pages
-
iterableByPage
public Iterable<P> iterableByPage(C continuationToken, int preferredPageSize)
Retrieve theIterable
, one page at a time, with each page containingpreferredPageSize
items, starting from the next page associated with the given continuation token. To start from first page, useiterableByPage()
oriterableByPage(int)
instead.- Parameters:
preferredPageSize
- the preferred page size, service may or may not honor the page size preference hence client MUST be prepared to handle pages with different page size.continuationToken
- The continuation token used to fetch the next page- Returns:
Iterable
of a pages
-
-