CursorBasedPagingObject

@Serializable
data class CursorBasedPagingObject<T : Any>(val href: String, val items: List<T>, val limit: Int, val next: String? = null, val cursor: Cursor? = null, val total: Int = 0, val offset: Int = 0, val previous: String? = null) : PagingObjectBase<T, CursorBasedPagingObject<T>> (source)

The cursor-based 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 next and cursors that can be useful in future calls.

Parameters

href

A link to the Web API endpoint returning the full result of the request.

items

The requested data.

limit

The maximum number of items in the response (as set in the query or by default).

next

URL to the next page of items. ( null if none)

total

The maximum number of items available to return.

cursor

The cursors used to find the next set of items. If items is empty, cursor may be null.

Constructors

Link copied to clipboard
constructor(href: String, items: List<T>, limit: Int, next: String? = null, cursor: Cursor? = null, total: Int = 0, offset: Int = 0, previous: String? = null)

Properties

Link copied to clipboard
@Transient
lateinit var api: GenericSpotifyApi

The API client associated with the request

Link copied to clipboard
@SerialName(value = "cursors")
val cursor: Cursor? = null
Link copied to clipboard
open override val href: String
Link copied to clipboard
open override val items: List<T>
Link copied to clipboard
open override val limit: Int
Link copied to clipboard
open override val next: String? = null
Link copied to clipboard
open override val offset: Int = 0

The offset of the items returned (as set in the query or by default).

Link copied to clipboard
open override val previous: String? = null

URL to the previous page of items. ( null if none)

Link copied to clipboard
open override val size: Int
Link copied to clipboard
open override val total: Int = 0

Functions

Link copied to clipboard
open operator override fun contains(element: T?): Boolean
Link copied to clipboard
open override fun containsAll(elements: Collection<T?>): Boolean
Link copied to clipboard
@FlowPreview
@ExperimentalCoroutinesApi
fun flow(context: CoroutineContext = Dispatchers.Default): Flow<T?>

Flow the Paging action.

Link copied to clipboard

Flow from current page backwards.

Link copied to clipboard
@ExperimentalCoroutinesApi
fun flowEndOrdered(): Flow<CursorBasedPagingObject<T>>
Link copied to clipboard
@ExperimentalCoroutinesApi
fun flowForward(): Flow<CursorBasedPagingObject<T>>

Flow from current page forwards.

Link copied to clipboard
@FlowPreview
@ExperimentalCoroutinesApi
fun flowOrdered(context: CoroutineContext = Dispatchers.Default): Flow<T?>

Flow the paging action ordered. This can be less performant than flow if you are in the middle of the pages.

Link copied to clipboard
@ExperimentalCoroutinesApi
fun flowPagingObjects(context: CoroutineContext = Dispatchers.Default): Flow<CursorBasedPagingObject<T>>

Flow the paging objects.

Link copied to clipboard
@ExperimentalCoroutinesApi
fun flowPagingObjectsOrdered(context: CoroutineContext = Dispatchers.Default): Flow<CursorBasedPagingObject<T>>

Flow the paging objects ordered. This can be less performant than flowPagingObjects if you are in the middle of the pages.

Link copied to clipboard
@ExperimentalCoroutinesApi
fun flowStartOrdered(): Flow<CursorBasedPagingObject<T>>
Link copied to clipboard
open operator override fun get(index: Int): T
Link copied to clipboard
open suspend override fun getAllItems(): List<T?>

Get all items of type T associated with the request

Link copied to clipboard
suspend fun getAllItemsNotNull(): List<T>

Get all items of type T associated with the request. Filters out null objects.

Link copied to clipboard

Get all items of type T associated with the request. Filters out null objects.

Link copied to clipboard

Retrieve all T associated with this rest action

Link copied to clipboard
open suspend override fun getAllPagingObjects(): List<CursorBasedPagingObject<T>>

Retrieve all PagingObjectBase associated with this rest action

Link copied to clipboard

Retrieve all PagingObjectBase associated with this rest action

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Synchronously retrieve the next total paging objects associated with this CursorBasedPagingObject, including this CursorBasedPagingObject.

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

Link copied to clipboard

Retrieve the items associated with the next total paging objects associated with this rest action, including the current one.

Link copied to clipboard
open suspend override fun getWithNextTotalPagingObjects(total: Int): List<CursorBasedPagingObject<T>>

Synchronously retrieve the next total paging objects associated with this PagingObjectBase, including this PagingObjectBase.

Link copied to clipboard

Synchronously retrieve the next total paging objects associated with this PagingObjectBase, including this PagingObjectBase.

Link copied to clipboard
open override fun indexOf(element: T?): Int
Link copied to clipboard
open override fun isEmpty(): Boolean
Link copied to clipboard
open operator override fun iterator(): Iterator<T>
Link copied to clipboard
open override fun lastIndexOf(element: T?): Int
Link copied to clipboard
open override fun listIterator(): ListIterator<T>
open override fun listIterator(index: Int): ListIterator<T>
Link copied to clipboard
open override fun subList(fromIndex: Int, toIndex: Int): List<T>
Link copied to clipboard
open suspend override fun take(n: Int): List<T>

Returns a list containing at most first n elements. Note that additional requests may be performed. The limit used in the request used to produce this PagingObjectBase will be respected, so choose limit carefully.