Pagination

interface Pagination : ClosedRange<Int>

Base interface of pagination

If you want to request something, you should use SimplePagination. If you need to return some result including pagination - PaginationResult

Functions

Link copied to clipboard
open operator fun contains(value: Int): Boolean
Link copied to clipboard
open fun isEmpty(): Boolean

Properties

Link copied to clipboard
open override val endInclusive: Int
Link copied to clipboard
abstract val page: Int

Started with 0. Number of page inside of pagination. Offset can be calculated as page * size

Link copied to clipboard
abstract val size: Int

Can be 0, but can't be < 0 Size of current page. Offset can be calculated as page * size

Link copied to clipboard
open override val start: Int

Inheritors

Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
Link copied to clipboard

First number in index of objects. It can be used as offset for databases or other data sources

Link copied to clipboard
Link copied to clipboard

Logical shortcut for comparison that page is 0

Link copied to clipboard

Last number in index of objects. In fact, one Pagination object represent data in next range:

Link copied to clipboard

Last number in index of objects. In fact, one Pagination object represent data in next range:

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Pagination.optionallyReverse(objectsCount: Int, reverse: Boolean): Pagination
fun Pagination.optionallyReverse(objectsCount: Long, reverse: Boolean): Pagination
Link copied to clipboard

Example:

Shortcut for reverse