PaginationResult

@Serializable
data class PaginationResult<T>(val page: Int, val size: Int, val results: List<T>, val objectsNumber: Long) : Pagination(source)

Parameters

page

Current page number

size

Current page size. It can be greater than size of results

results

Result objects

objectsNumber

Count of all objects across all pages

Constructors

Link copied to clipboard
constructor(page: Int, results: List<T>, pagesNumber: Int, size: Int)
constructor(page: Int, size: Int, results: List<T>, objectsNumber: Long)

Properties

Link copied to clipboard
Link copied to clipboard
open override val endInclusive: Int
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

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
open override val page: Int
Link copied to clipboard
@EncodeDefault
val pagesNumber: Int

Amount of pages for current pagination

Link copied to clipboard
val results: List<T>
Link copied to clipboard
open override val size: Int
Link copied to clipboard
open override val start: Int

Functions

Link copied to clipboard
Link copied to clipboard
open operator fun contains(value: Int): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun isEmpty(): Boolean
Link copied to clipboard
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

Shortcut for reverse

Example:

Link copied to clipboard