Package dev.inmo.micro_utils.pagination.utils

Types

PaginatedIterable
Link copied to clipboard
class PaginatedIterable<T>(pageSize: Int, countGetter: () -> Long, paginationResultGetter: Pagination.() -> PaginationResult<T>) : Iterable<T>
class PaginatedIterable<T>(pageSize: Int, countGetter: () -> Long, paginationResultGetter: Pagination.() -> PaginationResult<T>) : Iterable<T>
class PaginatedIterable<T>(pageSize: Int, countGetter: () -> Long, paginationResultGetter: Pagination.() -> PaginationResult<T>) : Iterable<T>
PaginatedIterator
Link copied to clipboard
class PaginatedIterator<T>(pageSize: Int, countGetter: () -> Long, paginationResultGetter: Pagination.() -> PaginationResult<T>) : Iterator<T>
class PaginatedIterator<T>(pageSize: Int, countGetter: () -> Long, paginationResultGetter: Pagination.() -> PaginationResult<T>) : Iterator<T>
class PaginatedIterator<T>(pageSize: Int, countGetter: () -> Long, paginationResultGetter: Pagination.() -> PaginationResult<T>) : Iterator<T>

Functions

doAllWithCurrentPaging
Link copied to clipboard
suspend fun <T> doAllWithCurrentPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend (Pagination) -> PaginationResult<T>)
suspend fun <T> doAllWithCurrentPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend (Pagination) -> PaginationResult<T>)
suspend fun <T> doAllWithCurrentPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend (Pagination) -> PaginationResult<T>)
doForAll
Link copied to clipboard
suspend fun <T> doForAll(initialPagination: Pagination = FirstPagePagination(), paginationMapper: (PaginationResult<T>) -> Pagination?, block: suspend (Pagination) -> PaginationResult<T>)
suspend fun <T> doForAll(initialPagination: Pagination = FirstPagePagination(), paginationMapper: (PaginationResult<T>) -> Pagination?, block: suspend (Pagination) -> PaginationResult<T>)
suspend fun <T> doForAll(initialPagination: Pagination = FirstPagePagination(), paginationMapper: (PaginationResult<T>) -> Pagination?, block: suspend (Pagination) -> PaginationResult<T>)
doForAllWithCurrentPaging
Link copied to clipboard
suspend fun <T> doForAllWithCurrentPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend (Pagination) -> PaginationResult<T>)
suspend fun <T> doForAllWithCurrentPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend (Pagination) -> PaginationResult<T>)
suspend fun <T> doForAllWithCurrentPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend (Pagination) -> PaginationResult<T>)
doForAllWithNextPaging
Link copied to clipboard
suspend fun <T> doForAllWithNextPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend (Pagination) -> PaginationResult<T>)
suspend fun <T> doForAllWithNextPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend (Pagination) -> PaginationResult<T>)
suspend fun <T> doForAllWithNextPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend (Pagination) -> PaginationResult<T>)
getAll
Link copied to clipboard
suspend fun <T> getAll(initialPagination: Pagination = FirstPagePagination(), paginationMapper: (PaginationResult<T>) -> Pagination?, block: suspend (Pagination) -> PaginationResult<T>): List<T>
suspend fun <T> getAll(initialPagination: Pagination = FirstPagePagination(), paginationMapper: (PaginationResult<T>) -> Pagination?, block: suspend (Pagination) -> PaginationResult<T>): List<T>
suspend fun <T> getAll(initialPagination: Pagination = FirstPagePagination(), paginationMapper: (PaginationResult<T>) -> Pagination?, block: suspend (Pagination) -> PaginationResult<T>): List<T>
getAllBy
Link copied to clipboard
suspend fun <T, R> R.getAllBy(initialPagination: Pagination = FirstPagePagination(), paginationMapper: R.(PaginationResult<T>) -> Pagination?, block: suspend R.(Pagination) -> PaginationResult<T>): List<T>
suspend fun <T, R> R.getAllBy(initialPagination: Pagination = FirstPagePagination(), paginationMapper: R.(PaginationResult<T>) -> Pagination?, block: suspend R.(Pagination) -> PaginationResult<T>): List<T>
suspend fun <T, R> R.getAllBy(initialPagination: Pagination = FirstPagePagination(), paginationMapper: R.(PaginationResult<T>) -> Pagination?, block: suspend R.(Pagination) -> PaginationResult<T>): List<T>
getAllByWithCurrentPaging
Link copied to clipboard
suspend fun <T, R> R.getAllByWithCurrentPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend R.(Pagination) -> PaginationResult<T>): List<T>
suspend fun <T, R> R.getAllByWithCurrentPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend R.(Pagination) -> PaginationResult<T>): List<T>
suspend fun <T, R> R.getAllByWithCurrentPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend R.(Pagination) -> PaginationResult<T>): List<T>
getAllByWithNextPaging
Link copied to clipboard
suspend fun <T, R> R.getAllByWithNextPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend R.(Pagination) -> PaginationResult<T>): List<T>
suspend fun <T, R> R.getAllByWithNextPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend R.(Pagination) -> PaginationResult<T>): List<T>
suspend fun <T, R> R.getAllByWithNextPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend R.(Pagination) -> PaginationResult<T>): List<T>
getAllWithCurrentPaging
Link copied to clipboard
suspend fun <T> getAllWithCurrentPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend (Pagination) -> PaginationResult<T>): List<T>
suspend fun <T> getAllWithCurrentPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend (Pagination) -> PaginationResult<T>): List<T>
suspend fun <T> getAllWithCurrentPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend (Pagination) -> PaginationResult<T>): List<T>
getAllWithNextPaging
Link copied to clipboard
suspend fun <T> getAllWithNextPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend (Pagination) -> PaginationResult<T>): List<T>
suspend fun <T> getAllWithNextPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend (Pagination) -> PaginationResult<T>): List<T>
suspend fun <T> getAllWithNextPaging(initialPagination: Pagination = FirstPagePagination(), block: suspend (Pagination) -> PaginationResult<T>): List<T>
makeIterable
Link copied to clipboard
inline fun <T> makeIterable(noinline countGetter: () -> Long, pageSize: Int = defaultPaginationPageSize, noinline paginationResultGetter: Pagination.() -> PaginationResult<T>): Iterable<T>

Will make iterable using incoming countGetter and paginationResultGetter

inline fun <T> makeIterable(noinline countGetter: () -> Long, pageSize: Int = defaultPaginationPageSize, noinline paginationResultGetter: Pagination.() -> PaginationResult<T>): Iterable<T>

Will make iterable using incoming countGetter and paginationResultGetter

inline fun <T> makeIterable(noinline countGetter: () -> Long, pageSize: Int = defaultPaginationPageSize, noinline paginationResultGetter: Pagination.() -> PaginationResult<T>): Iterable<T>

Will make iterable using incoming countGetter and paginationResultGetter

optionallyReverse
Link copied to clipboard
inline fun <T> Array<T>.optionallyReverse(reverse: Boolean): Array<T>
fun <T> Iterable<T>.optionallyReverse(reverse: Boolean): Iterable<T>
fun <T> List<T>.optionallyReverse(reverse: Boolean): List<T>
fun <T> Set<T>.optionallyReverse(reverse: Boolean): Set<T>
fun Pagination.optionallyReverse(objectsCount: Int, reverse: Boolean): Pagination
fun Pagination.optionallyReverse(objectsCount: Long, reverse: Boolean): Pagination
inline fun <T> Array<T>.optionallyReverse(reverse: Boolean): Array<T>
fun <T> Iterable<T>.optionallyReverse(reverse: Boolean): Iterable<T>
fun <T> List<T>.optionallyReverse(reverse: Boolean): List<T>
fun <T> Set<T>.optionallyReverse(reverse: Boolean): Set<T>
fun Pagination.optionallyReverse(objectsCount: Int, reverse: Boolean): Pagination
fun Pagination.optionallyReverse(objectsCount: Long, reverse: Boolean): Pagination
inline fun <T> Array<T>.optionallyReverse(reverse: Boolean): Array<T>
fun <T> Iterable<T>.optionallyReverse(reverse: Boolean): Iterable<T>
fun <T> List<T>.optionallyReverse(reverse: Boolean): List<T>
fun <T> Set<T>.optionallyReverse(reverse: Boolean): Set<T>
fun Pagination.optionallyReverse(objectsCount: Int, reverse: Boolean): Pagination
fun Pagination.optionallyReverse(objectsCount: Long, reverse: Boolean): Pagination
paginate
Link copied to clipboard
fun <T> Iterable<T>.paginate(with: Pagination): PaginationResult<T>
fun <T> List<T>.paginate(with: Pagination): PaginationResult<T>
fun <T> Set<T>.paginate(with: Pagination): PaginationResult<T>
fun <T> Iterable<T>.paginate(with: Pagination): PaginationResult<T>
fun <T> List<T>.paginate(with: Pagination): PaginationResult<T>
fun <T> Set<T>.paginate(with: Pagination): PaginationResult<T>
fun <T> Iterable<T>.paginate(with: Pagination): PaginationResult<T>
fun <T> List<T>.paginate(with: Pagination): PaginationResult<T>
fun <T> Set<T>.paginate(with: Pagination): PaginationResult<T>
reverse
Link copied to clipboard
fun Pagination.reverse(objectsCount: Int): SimplePagination

Shortcut for reverse

fun Pagination.reverse(datasetSize: Long): SimplePagination

Example:

fun Pagination.reverse(objectsCount: Int): SimplePagination

Shortcut for reverse

fun Pagination.reverse(datasetSize: Long): SimplePagination

Example:

fun Pagination.reverse(objectsCount: Int): SimplePagination

Shortcut for reverse

fun Pagination.reverse(datasetSize: Long): SimplePagination

Example: