PaginationResult

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

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
fun <T> PaginationResult(page: Int, results: List<T>, pagesNumber: Int, size: Int)
Link copied to clipboard
fun <T> PaginationResult(page: Int, size: Int, results: List<T>, objectsNumber: Long)

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

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

Extensions

Link copied to clipboard
Link copied to clipboard
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
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

Link copied to clipboard