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 aContinuablePageP- TheContinuablePageholding items of typeT.
- All Implemented Interfaces:
Iterable<T>
- Direct Known Subclasses:
PagedIterableBase
public 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 containingpreferredPageSizeitems.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 containingpreferredPageSizeitems, starting from the next page associated with the given continuation token.Iterator<T>iterator()Utility function to provideIteratorof valueT.Stream<T>stream()Utility function to provideStreamof 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 containingpreferredPageSizeitems.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 containingpreferredPageSizeitems, 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:IterableStreamUtility function to provideStreamof valueT.- Overrides:
streamin classIterableStream<T>- Returns:
Streamof valueT.
-
streamByPage
public Stream<P> streamByPage()
Retrieve theStream, one page at a time. It will provide sameStreamof T values from starting if called multiple times.- Returns:
Streamof 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:
Streamof a pages
-
streamByPage
public Stream<P> streamByPage(int preferredPageSize)
Retrieve theStream, one page at a time, with each page containingpreferredPageSizeitems. It will provide sameStreamof 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:
Streamof a pages
-
streamByPage
public Stream<P> streamByPage(C continuationToken, int preferredPageSize)
Retrieve theStream, one page at a time, with each page containingpreferredPageSizeitems, 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:
Streamof a pages
-
iterator
public Iterator<T> iterator()
Description copied from class:IterableStreamUtility function to provideIteratorof valueT.
-
iterableByPage
public Iterable<P> iterableByPage()
Retrieve theIterable, one page at a time. It will provide sameIterableof T values from starting if called multiple times.- Returns:
Streamof 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:
Iterableof a pages
-
iterableByPage
public Iterable<P> iterableByPage(int preferredPageSize)
Retrieve theIterable, one page at a time, with each page containingpreferredPageSizeitems. It will provide sameIterableof 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:
Iterableof a pages
-
iterableByPage
public Iterable<P> iterableByPage(C continuationToken, int preferredPageSize)
Retrieve theIterable, one page at a time, with each page containingpreferredPageSizeitems, 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:
Iterableof a pages
-
-