PaginatedIterator

class PaginatedIterator<T>(pageSize: Int, countGetter: () -> Long, paginationResultGetter: Pagination.() -> PaginationResult<T>) : Iterator<T> (source)

An iterator that lazily fetches items from a paginated data source. It automatically fetches the next page when the current page is exhausted.

Parameters

pageSize

The size of each page to fetch

countGetter

A function that returns the total count of available items

paginationResultGetter

A function that fetches a page of results for a given pagination

Type Parameters

T

The type of items being iterated

Constructors

Link copied to clipboard
constructor(pageSize: Int, countGetter: () -> Long, paginationResultGetter: Pagination.() -> PaginationResult<T>)

Functions

Link copied to clipboard
open operator override fun hasNext(): Boolean
Link copied to clipboard
open operator override fun next(): T