paginate

Paginates this Iterable according to the given Pagination parameters. Returns a PaginationResult containing the items within the specified page range.

Return

A PaginationResult containing the items from the requested page

Parameters

with

The pagination parameters specifying which page to retrieve

Type Parameters

T

The type of items in the iterable


Paginates this List according to the given Pagination parameters. Returns a PaginationResult containing the items within the specified page range. More efficient than the Iterable version as it uses direct indexing.

Return

A PaginationResult containing the items from the requested page

Parameters

with

The pagination parameters specifying which page to retrieve

Type Parameters

T

The type of items in the list


fun <T> List<T>.paginate(with: Pagination, reversed: Boolean): PaginationResult<T>(source)

Paginates this List according to the given Pagination parameters, optionally in reverse order.

Return

A PaginationResult containing the items from the requested page, optionally reversed

Parameters

with

The pagination parameters specifying which page to retrieve

reversed

If true, the list will be paginated in reverse order

Type Parameters

T

The type of items in the list


Paginates this Set according to the given Pagination parameters. Returns a PaginationResult containing the items within the specified page range.

Return

A PaginationResult containing the items from the requested page

Parameters

with

The pagination parameters specifying which page to retrieve

Type Parameters

T

The type of items in the set


fun <T> Set<T>.paginate(with: Pagination, reversed: Boolean): PaginationResult<T>(source)

Paginates this Set according to the given Pagination parameters, optionally in reverse order.

Return

A PaginationResult containing the items from the requested page, optionally reversed

Parameters

with

The pagination parameters specifying which page to retrieve

reversed

If true, the set will be paginated in reverse order

Type Parameters

T

The type of items in the set