CursorBasedPagingObject

data class CursorBasedPagingObject<T : Any>(href: String, items: List<T>, limit: Int, next: String?, cursor: Cursor?, total: Int, offset: Int, previous: String?) : PagingObjectBase<T, CursorBasedPagingObject<T>>

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

CursorBasedPagingObject
Link copied to clipboard
common
fun <T : Any> CursorBasedPagingObject(href: String, items: List<T>, limit: Int, next: String? = null, cursor: Cursor? = null, total: Int = 0, offset: Int = 0, previous: String? = null)
A link to the Web API endpoint returning the full result of the request.

Functions

component1
Link copied to clipboard
common
operator fun component1(): String
component2
Link copied to clipboard
common
operator fun component2(): List<T>
component3
Link copied to clipboard
common
operator fun component3(): Int
component4
Link copied to clipboard
common
operator fun component4(): String?
component5
Link copied to clipboard
common
operator fun component5(): Cursor?
component6
Link copied to clipboard
common
operator fun component6(): Int
component7
Link copied to clipboard
common
operator fun component7(): Int
component8
Link copied to clipboard
common
operator fun component8(): String?
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
copy
Link copied to clipboard
common
fun copy(href: String, items: List<T>, limit: Int, next: String? = null, cursor: Cursor? = null, total: Int = 0, offset: Int = 0, previous: String? = null): CursorBasedPagingObject<T>
equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): 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
@ExperimentalCoroutinesApi()
fun flowBackward(): Flow<CursorBasedPagingObject<T>>
Flow from current page backwards.
flowEndOrdered
Link copied to clipboard
common
@ExperimentalCoroutinesApi()
fun flowEndOrdered(): Flow<CursorBasedPagingObject<T>>
flowForward
Link copied to clipboard
common
@ExperimentalCoroutinesApi()
fun flowForward(): Flow<CursorBasedPagingObject<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<CursorBasedPagingObject<T>>
Flow the paging objects.
flowPagingObjectsOrdered
Link copied to clipboard
common
@ExperimentalCoroutinesApi()
fun flowPagingObjectsOrdered(context: CoroutineContext = Dispatchers.Default): Flow<CursorBasedPagingObject<T>>
Flow the paging objects ordered.
flowStartOrdered
Link copied to clipboard
common
@ExperimentalCoroutinesApi()
fun flowStartOrdered(): Flow<CursorBasedPagingObject<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.
getAllPagingObjects
Link copied to clipboard
common
open suspend override fun getAllPagingObjects(): List<CursorBasedPagingObject<T>>
Retrieve all PagingObjectBase associated with this rest action
getCursorBasedPagingObject
Link copied to clipboard
common
suspend fun getCursorBasedPagingObject(url: String): CursorBasedPagingObject<T>?
getNext
Link copied to clipboard
common
suspend fun getNext(): CursorBasedPagingObject<T>?
getPrevious
Link copied to clipboard
common
suspend fun getPrevious(): CursorBasedPagingObject<T>?
getWithNext
Link copied to clipboard
common
suspend fun getWithNext(total: Int): List<CursorBasedPagingObject<T>>
Synchronously retrieve the next total paging objects associated with this CursorBasedPagingObject, including this CursorBasedPagingObject.
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.
getWithNextTotalPagingObjects
Link copied to clipboard
common
open suspend override fun getWithNextTotalPagingObjects(total: Int): List<CursorBasedPagingObject<T>>
Synchronously retrieve the next total paging objects associated with this PagingObjectBase, including this PagingObjectBase.
hashCode
Link copied to clipboard
common
open override fun hashCode(): Int
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.
toString
Link copied to clipboard
common
open override fun toString(): String

Properties

api
Link copied to clipboard
common
lateinit var api: GenericSpotifyApi
The API client associated with the request
cursor
Link copied to clipboard
common
val cursor: Cursor? = null
The cursors used to find the next set of items.
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 = 0
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

(source)
Link copied to clipboard