Class OffsetBasedPaginatedService<T>
java.lang.Object
com.symphony.bdk.core.service.pagination.PaginatedService
com.symphony.bdk.core.service.pagination.OffsetBasedPaginatedService<T>
- Type Parameters:
T
- the type of objects to retrieve
Retrieve a list of elements given a
OffsetBasedPaginatedApi
.
Goal is to fetch elements lazily.-
Field Summary
Fields inherited from class com.symphony.bdk.core.service.pagination.PaginatedService
chunkSize, DEFAULT_PAGINATION_CHUNK_SIZE, DEFAULT_PAGINATION_TOTAL_SIZE, maxSize
-
Constructor Summary
ConstructorDescriptionOffsetBasedPaginatedService
(OffsetBasedPaginatedApi<T> paginatedApi, Integer chunkSize, Integer maxSize) The only constructor -
Method Summary
-
Constructor Details
-
OffsetBasedPaginatedService
public OffsetBasedPaginatedService(OffsetBasedPaginatedApi<T> paginatedApi, Integer chunkSize, Integer maxSize) The only constructor- Parameters:
paginatedApi
- the paginated api used to retrieve the chunks of elementschunkSize
- the maximum number to retrieve in one call ofOffsetBasedPaginatedApi.get(int, int)
maxSize
- the maximum number to retrieve in total
-
-
Method Details
-
stream
Returns an stream of elements with lazy fetching.- Returns:
- a
Stream
which lazily makes calls to thepaginatedApi
.
-