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
- See Also:
-
Constructor Summary
ConstructorDescriptionContinuablePagedIterable
(ContinuablePagedFlux<C, T, P> pagedFlux) Creates instance with the givenContinuablePagedFlux
.ContinuablePagedIterable
(ContinuablePagedFlux<C, T, P> pagedFlux, int batchSize) Creates instance with the givenContinuablePagedFlux
.ContinuablePagedIterable
(Supplier<PageRetrieverSync<C, P>> pageRetrieverSyncProvider, Integer pageSize, Predicate<C> continuationPredicate) Creates instance with the givenprovider
. -
Method Summary
Modifier and TypeMethodDescriptionRetrieve theIterable
, one page at a time.iterableByPage
(int preferredPageSize) Retrieve theIterable
, one page at a time, with each page containingpreferredPageSize
items.iterableByPage
(C continuationToken) Retrieve theIterable
, one page at a time, starting from the next page associated with the given continuation token.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()
Utility function to provideIterator
of valueT
.stream()
Utility function to provideStream
of valueT
.Retrieve theStream
, one page at a time.streamByPage
(int preferredPageSize) Retrieve theStream
, one page at a time, with each page containingpreferredPageSize
items.streamByPage
(C continuationToken) Retrieve theStream
, one page at a time, starting from the next page associated with the given continuation token.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 Details
-
ContinuablePagedIterable
Creates instance with the givenContinuablePagedFlux
.- Parameters:
pagedFlux
- the paged flux use as iterable
-
ContinuablePagedIterable
Creates instance with the givenContinuablePagedFlux
.- Parameters:
pagedFlux
- the paged flux use as iterablebatchSize
- the bounded capacity to prefetch from theContinuablePagedFlux
-
ContinuablePagedIterable
public ContinuablePagedIterable(Supplier<PageRetrieverSync<C, P>> pageRetrieverSyncProvider, Integer pageSize, Predicate<C> continuationPredicate) Creates instance with the givenprovider
.- Parameters:
pageRetrieverSyncProvider
- A provider that returnsPageRetrieverSync
.pageSize
- The preferred page size.continuationPredicate
- A predicate which determines if paging should continue.- Throws:
NullPointerException
- IfpageRetrieverSyncProvider
is null.IllegalArgumentException
- IfpageSize
is not null and is less than or equal to zero.
-
-
Method Details
-
stream
Description copied from class:IterableStream
Utility function to provideStream
of valueT
.- Overrides:
stream
in classIterableStream<T>
- Returns:
Stream
of valueT
.
-
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
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
Retrieve theStream
, one page at a time, with each page containingpreferredPageSize
items.It will provide same
Stream
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
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
Description copied from class:IterableStream
Utility function to provideIterator
of valueT
. -
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
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
Retrieve theIterable
, one page at a time, with each page containingpreferredPageSize
items.It will provide same
Iterable
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
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
-