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

@API(status=INTERNAL) public class OffsetBasedPaginatedService<T> extends PaginatedService
Retrieve a list of elements given a OffsetBasedPaginatedApi. Goal is to fetch elements lazily.
  • 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 elements
      chunkSize - the maximum number to retrieve in one call of OffsetBasedPaginatedApi.get(int, int)
      maxSize - the maximum number to retrieve in total
  • Method Details

    • stream

      public Stream<T> stream()
      Returns an stream of elements with lazy fetching.
      Returns:
      a Stream which lazily makes calls to the paginatedApi.