PagingObject

data class PagingObject<T : Any>(href: String, items: List<T>, limit: Int, next: String?, offset: Int, previous: String?, total: Int) : AbstractPagingObject<T, PagingObject<T>>

The offset-based non-nullable paging object is a container for a set of objects. It contains a key called items (whose value is an array of the requested objects) along with other keys like previous, next and limit that can be useful in future calls.

Constructors

PagingObject
Link copied to clipboard
common
fun <T : Any> PagingObject(href: String, items: List<T>, limit: Int, next: String? = null, offset: Int, previous: String? = null, total: Int = 0)

Functions

contains
Link copied to clipboard
common
open operator override fun contains(element: T?): Boolean
containsAll
Link copied to clipboard
common
open override fun containsAll(elements: Collection<T?>): Boolean
flow
Link copied to clipboard
common
@FlowPreview()
@ExperimentalCoroutinesApi()
fun flow(context: CoroutineContext = Dispatchers.Default): Flow<T?>
Flow the Paging action.
flowBackward
Link copied to clipboard
common
fun flowBackward(): Flow<PagingObject<T>>
Flow from current page backwards.
flowEndOrdered
Link copied to clipboard
common
@ExperimentalCoroutinesApi()
fun flowEndOrdered(): Flow<PagingObject<T>>
flowForward
Link copied to clipboard
common
@ExperimentalCoroutinesApi()
fun flowForward(): Flow<PagingObject<T>>
Flow from current page forwards.
flowOrdered
Link copied to clipboard
common
@FlowPreview()
@ExperimentalCoroutinesApi()
fun flowOrdered(context: CoroutineContext = Dispatchers.Default): Flow<T?>
Flow the paging action ordered.
flowPagingObjects
Link copied to clipboard
common
@ExperimentalCoroutinesApi()
fun flowPagingObjects(context: CoroutineContext = Dispatchers.Default): Flow<PagingObject<T>>
Flow the paging objects.
flowPagingObjectsOrdered
Link copied to clipboard
common
@ExperimentalCoroutinesApi()
fun flowPagingObjectsOrdered(context: CoroutineContext = Dispatchers.Default): Flow<PagingObject<T>>
Flow the paging objects ordered.
flowStartOrdered
Link copied to clipboard
common
@ExperimentalCoroutinesApi()
fun flowStartOrdered(): Flow<PagingObject<T>>
get
Link copied to clipboard
common
open operator override fun get(index: Int): T
getAllItems
Link copied to clipboard
common
open suspend override fun getAllItems(): List<T?>
Get all items of type T associated with the request
getAllItemsNotNull
Link copied to clipboard
common
suspend fun getAllItemsNotNull(): List<T>
Get all items of type T associated with the request.
getAllItemsNotNullRestAction
Link copied to clipboard
common
fun getAllItemsNotNullRestAction(): SpotifyRestAction<List<T>>
Get all items of type T associated with the request.
getAllItemsRestAction
Link copied to clipboard
common
fun getAllItemsRestAction(): SpotifyRestAction<List<T?>>
Retrieve all T associated with this rest action
getAllPagingObjects
Link copied to clipboard
common
open suspend override fun getAllPagingObjects(): List<PagingObject<T>>
Retrieve all PagingObjectBase associated with this rest action
getAllPagingObjectsRestAction
Link copied to clipboard
common
Retrieve all PagingObjectBase associated with this rest action
getNext
Link copied to clipboard
common
suspend fun getNext(): PagingObject<T>?
getNextRestAction
Link copied to clipboard
common
fun getNextRestAction(): SpotifyRestAction<PagingObject<T>?>
getPrevious
Link copied to clipboard
common
suspend fun getPrevious(): PagingObject<T>?
getPreviousRestAction
Link copied to clipboard
common
fun getPreviousRestAction(): SpotifyRestAction<PagingObject<T>?>
getWithNext
Link copied to clipboard
common
suspend fun getWithNext(total: Int): List<PagingObject<T>>
Synchronously retrieve the next total paging objects associated with this AbstractPagingObject, including this AbstractPagingObject.
getWithNextItems
Link copied to clipboard
common
suspend fun getWithNextItems(total: Int): List<T?>
Retrieve the items associated with the next total paging objects associated with this rest action, including the current one.
getWithNextItemsRestAction
Link copied to clipboard
common
fun getWithNextItemsRestAction(total: Int): SpotifyRestAction<List<T?>>
Retrieve the items associated with the next total paging objects associated with this rest action, including the current one.
getWithNextTotalPagingObjects
Link copied to clipboard
common
open suspend override fun getWithNextTotalPagingObjects(total: Int): List<PagingObject<T>>
Synchronously retrieve the next total paging objects associated with this PagingObjectBase, including this PagingObjectBase.
getWithNextTotalPagingObjectsRestAction
Link copied to clipboard
common
Synchronously retrieve the next total paging objects associated with this PagingObjectBase, including this PagingObjectBase.
indexOf
Link copied to clipboard
common
open override fun indexOf(element: T?): Int
isEmpty
Link copied to clipboard
common
open override fun isEmpty(): Boolean
iterator
Link copied to clipboard
common
open operator override fun iterator(): Iterator<T>
lastIndexOf
Link copied to clipboard
common
open override fun lastIndexOf(element: T?): Int
listIterator
Link copied to clipboard
common
open override fun listIterator(): ListIterator<T>
open override fun listIterator(index: Int): ListIterator<T>
subList
Link copied to clipboard
common
open override fun subList(fromIndex: Int, toIndex: Int): List<T>
take
Link copied to clipboard
common
open suspend override fun take(n: Int): List<T>
Returns a list containing at most first n elements.

Properties

api
Link copied to clipboard
common
lateinit var api: GenericSpotifyApi
The API client associated with the request
href
Link copied to clipboard
common
open override val href: String
A link to the Web API endpoint returning the full result of the request.
items
Link copied to clipboard
common
open override val items: List<T>
The requested data.
limit
Link copied to clipboard
common
open override val limit: Int
The maximum number of items in the response (as set in the query or by default).
next
Link copied to clipboard
common
open override val next: String? = null
URL to the next page of items.
offset
Link copied to clipboard
common
open override val offset: Int
The offset of the items returned (as set in the query or by default).
previous
Link copied to clipboard
common
open override val previous: String? = null
URL to the previous page of items.
size
Link copied to clipboard
common
open override val size: Int
total
Link copied to clipboard
common
open override val total: Int = 0
The maximum number of items available to return.

Sources

common source
Link copied to clipboard