# Package-level declarations

## Types

Pagination
Link copied to clipboard
interface Pagination : ClosedRange < Int >

Base interface of pagination

PaginationResult
Link copied to clipboard
@Serializable
data class PaginationResult < T >(val page: Int , val size: Int , val results: List < T >, val objectsNumber: Long ) : Pagination
SimplePagination
Link copied to clipboard
@Serializable
data class SimplePagination (val page: Int , val size: Int ) : Pagination

## Properties

asUrlQueryArrayParts
Link copied to clipboard
val Pagination . asUrlQueryArrayParts : Array < Pair < String , String >>
asUrlQueryParts
Link copied to clipboard
val Pagination . asUrlQueryParts : Map < String , String >
defaultExtraLargePageSize
Link copied to clipboard
const val defaultExtraLargePageSize : Int = 15
defaultLargePageSize
Link copied to clipboard
const val defaultLargePageSize : Int = 10
defaultMediumPageSize
Link copied to clipboard
const val defaultMediumPageSize : Int = 5
defaultPaginationPageSize
Link copied to clipboard
var defaultPaginationPageSize : Int
defaultSmallPageSize
Link copied to clipboard
const val defaultSmallPageSize : Int = 2
emptyPagination
Link copied to clipboard
val emptyPagination : SimplePagination
extractPagination
Link copied to clipboard
val Map < String , String ?>. extractPagination : Pagination
val ERROR CLASS: Symbol not found for ApplicationCall. extractPagination : Pagination
val ERROR CLASS: Symbol not found for Parameters. extractPagination : Pagination
firstIndex
Link copied to clipboard
val Pagination . firstIndex : Int

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

firstPageWithOneElementPagination
Link copied to clipboard
val firstPageWithOneElementPagination : SimplePagination
isFirstPage
Link copied to clipboard
val Pagination . isFirstPage : Boolean

Logical shortcut for comparison that page is 0

isLastPage
Link copied to clipboard
val PaginationResult <*>. isLastPage : Boolean
lastIndex
Link copied to clipboard
val Pagination . lastIndex : Int

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

lastIndexExclusive
Link copied to clipboard
val Pagination . lastIndexExclusive : Int

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

lastPage
Link copied to clipboard
val PaginationResult <*>. lastPage : Int
lastPageLong
Link copied to clipboard
val PaginationResult <*>. lastPageLong : Long
paginationPageKey
Link copied to clipboard
const val paginationPageKey : String
paginationSizeKey
Link copied to clipboard
const val paginationSizeKey : String

## Functions

calculatePage
Link copied to clipboard
fun calculatePage (firstIndex: Int , resultsSize: Int ): Int
calculatePagesNumber
Link copied to clipboard
fun calculatePagesNumber (datasetSize: Int , pageSize: Int ): Int
fun calculatePagesNumber (datasetSize: Long , pageSize: Int ): Int

Calculates pages count for given datasetSize

fun calculatePagesNumber (pageSize: Int , datasetSize: Long ): Int

Calculates pages count for given datasetSize. As a fact, it is shortcut for calculatePagesNumber

changeResults
Link copied to clipboard
inline fun < I , O > PaginationResult < I >. changeResults (block: PaginationResult < I >.() -> List < O >): PaginationResult < O >
fun < I , O > PaginationResult < I >. changeResults (data: List < O >): PaginationResult < O >
changeResultsUnchecked
Link copied to clipboard
inline fun < I , O > PaginationResult < I >. changeResultsUnchecked (block: PaginationResult < I >.() -> List < O >): PaginationResult < O >
fun < I , O > PaginationResult < I >. changeResultsUnchecked (data: List < O >): PaginationResult < O >
createPaginationResult
Link copied to clipboard
fun < T > Pair < Long , List < T >>. createPaginationResult (pagination: Pagination ): PaginationResult < T >
fun < T > List < T >. createPaginationResult (pagination: Pagination , commonObjectsNumber: Long ): PaginationResult < T >
fun < T > List < T >. createPaginationResult (firstIndex: Int , commonObjectsNumber: Long ): PaginationResult < T >
currentPageIfNotEmpty
Link copied to clipboard
fun < T > PaginationResult < T >. currentPageIfNotEmpty (): PaginationResult < T >?
currentPageIfNotEmptyOrLastPage
Link copied to clipboard
fun < T > PaginationResult < T >. currentPageIfNotEmptyOrLastPage (): PaginationResult < T >?
currentPageIfNotLastPage
Link copied to clipboard
fun < T > PaginationResult < T >. currentPageIfNotLastPage (): PaginationResult < T >?
doWithPagination
Link copied to clipboard
inline fun doWithPagination (startPagination: Pagination = FirstPagePagination(), requestMaker: (pagination: Pagination ) -> Pagination ?)
emptyPaginationResult
Link copied to clipboard
fun < T > emptyPaginationResult (): PaginationResult < T >
fun < T > emptyPaginationResult (basePagination: Pagination ): PaginationResult < T >
fun < T > emptyPaginationResult (basePagination: Pagination , objectsNumber: Number ): PaginationResult < T >
firstPage
Link copied to clipboard
fun Pagination . firstPage (): Pagination
FirstPagePagination
Link copied to clipboard
inline fun FirstPagePagination (size: Int = defaultPaginationPageSize): SimplePagination
intersect
Link copied to clipboard
fun Pagination . intersect (other: Pagination ): Pagination ?
nextPage
Link copied to clipboard
inline fun Pagination . nextPage (): SimplePagination
nextPageIfNotEmpty
Link copied to clipboard
fun PaginationResult <*>. nextPageIfNotEmpty (): SimplePagination ?
nextPageIfNotEmptyOrLastPage
Link copied to clipboard
fun PaginationResult <*>. nextPageIfNotEmptyOrLastPage (): SimplePagination ?
nextPageIfNotLastPage
Link copied to clipboard
fun PaginationResult <*>. nextPageIfNotLastPage (): SimplePagination ?
nextPageIfTrue
Link copied to clipboard
inline fun < T , PR : PaginationResult < T >> PR . nextPageIfTrue (condition: PR .() -> Boolean ): SimplePagination ?
paginate
Link copied to clipboard
fun ERROR CLASS: Symbol not found for Query. paginate (with: Pagination , orderBy: Pair <ERROR CLASS: Symbol not found for Expression<*>, ERROR CLASS: Symbol not found for SortOrder>? = null): ERROR CLASS: Cannot infer argument for type parameter R

Applies pagination to this Exposed Query. Sets the limit and offset based on the pagination parameters, and optionally orders the results.

fun ERROR CLASS: Symbol not found for Query. paginate (with: Pagination , orderBy: ERROR CLASS: Symbol not found for Expression<*>??, reversed: Boolean = false): ERROR CLASS: Cannot infer argument for type parameter R

Applies pagination to this Exposed Query with optional ordering and reversal. Sets the limit and offset based on the pagination parameters.

Pagination
Link copied to clipboard
fun Pagination (page: Int , size: Int ): SimplePagination

Factory for SimplePagination

PaginationByIndexes
Link copied to clipboard
fun PaginationByIndexes (firstIndex: Int , lastIndex: Int ): SimplePagination
previousPage
Link copied to clipboard
inline fun Pagination . previousPage (): SimplePagination

This method DO NOT check Pagination.page of receiver. Returns pagination for previous page

thisPageIfNotEmpty
Link copied to clipboard
fun < T > PaginationResult < T >. thisPageIfNotEmpty (): PaginationResult < T >?
thisPageIfNotEmptyOrLastPage
Link copied to clipboard
fun < T > PaginationResult < T >. thisPageIfNotEmptyOrLastPage (): PaginationResult < T >?
thisPageIfNotLastPage
Link copied to clipboard
fun < T > PaginationResult < T >. thisPageIfNotLastPage (): PaginationResult < T >?
thisPageIfTrue
Link copied to clipboard
inline fun < T , PR : PaginationResult < T >> PR . thisPageIfTrue (condition: PR .() -> Boolean ): PR ?