# PagedList.Builder

Artifact: [androidx.paging:paging-common](https://developer.android.com/jetpack/androidx/releases/paging) [View Source](https://cs.android.com/search?q=file:androidx/paging/PagedList.kt+class:androidx.paging.PagedList.Builder) Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

*** ** * ** ***

Common/AllAndroid/JVMNative/C/iOSJavaScript
- android

  ```
  class PagedList.Builder<Key : Any, Value : Any>
  ```

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData, which no longer supports constructing snapshots of loaded data manually, use this instead:
>
> ```kotlin
> Pager.flow
> ```

Builder class for `https://developer.android.com/reference/kotlin/androidx/paging/PagedList`.

`https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#pagingSource()`, `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#config()`, `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#notifyDispatcher()` and `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#fetchDispatcher()` must all be provided.

A `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` queries initial data from its `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource` during construction, to avoid empty `https://developer.android.com/reference/kotlin/androidx/paging/PagedList`s being presented to the UI when possible. It's preferred to present initial data, so that the UI doesn't show an empty list, or placeholders for a few frames, just before showing initial content.

`https://developer.android.com/reference/kotlin/androidx/paging/LivePagedListBuilder` does this creation on a background thread automatically, if you want to receive a `LiveData<PagedList<...>>`.

| Parameters |
|---|---|
| `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | Type of key used to load data from the `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`. |
| `<Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html>` | Type of items held and loaded by the `https://developer.android.com/reference/kotlin/androidx/paging/PagedList`. |

## Summary

| ### Public constructors |
|---|---|
| `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> [Builder](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#Builder(androidx.paging.DataSource,androidx.paging.PagedList.Config))( dataSource: https://developer.android.com/reference/kotlin/androidx/paging/DataSource<Key, Value>, config: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> [Builder](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#Builder(androidx.paging.DataSource,kotlin.Int))( dataSource: https://developer.android.com/reference/kotlin/androidx/paging/DataSource<Key, Value>, pageSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> [Builder](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#Builder(androidx.paging.PagingSource,androidx.paging.PagingSource.LoadResult.Page,androidx.paging.PagedList.Config))( pagingSource: https://developer.android.com/reference/kotlin/androidx/paging/PagingSource<Key, Value>, initialPage: https://developer.android.com/reference/kotlin/androidx/paging/PagingSource.LoadResult.Page<Key, Value>, config: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `<Key : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html, Value : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html> [Builder](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#Builder(androidx.paging.PagingSource,androidx.paging.PagingSource.LoadResult.Page,kotlin.Int))( pagingSource: https://developer.android.com/reference/kotlin/androidx/paging/PagingSource<Key, Value>, initialPage: https://developer.android.com/reference/kotlin/androidx/paging/PagingSource.LoadResult.Page<Key, Value>, pageSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |

| ### Public functions |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>` | `[build](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#build())()` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder<Key, Value>` | `[setBoundaryCallback](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setBoundaryCallback(androidx.paging.PagedList.BoundaryCallback))( boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>? )` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder<Key, Value>` | `[setCoroutineScope](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setCoroutineScope(kotlinx.coroutines.CoroutineScope))(coroutineScope: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/index.html)` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder<Key, Value>` | `[setFetchDispatcher](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setFetchDispatcher(kotlinx.coroutines.CoroutineDispatcher))(fetchDispatcher: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html)` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder<Key, Value>` | `[setFetchExecutor](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setFetchExecutor(java.util.concurrent.Executor))(fetchExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html)` **This function is deprecated.** Passing an executor will cause it get wrapped as a CoroutineDispatcher, consider passing a CoroutineDispatcher directly | android |
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder<Key, Value>` | `[setInitialKey](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setInitialKey(kotlin.Any))(initialKey: Key?)` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder<Key, Value>` | `[setNotifyDispatcher](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setNotifyDispatcher(kotlinx.coroutines.CoroutineDispatcher))(notifyDispatcher: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html)` **This function is deprecated.** PagedList is deprecated and has been replaced by PagingData | android |
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder<Key, Value>` | `[setNotifyExecutor](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setNotifyExecutor(java.util.concurrent.Executor))(notifyExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html)` **This function is deprecated.** Passing an executor will cause it get wrapped as a CoroutineDispatcher, consider passing a CoroutineDispatcher directly | android |

## Public constructors

### Builder

android

```
<Key : Any, Value : Any> [Builder](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#Builder(androidx.paging.DataSource,androidx.paging.PagedList.Config))(
    dataSource: DataSource<Key, Value>,
    config: PagedList.Config
)
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Create a `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder` with the provided `https://developer.android.com/reference/kotlin/androidx/paging/DataSource` and `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config`.

| Parameters |
|---|---|
| `dataSource: https://developer.android.com/reference/kotlin/androidx/paging/DataSource<Key, Value>` | `https://developer.android.com/reference/kotlin/androidx/paging/DataSource` the `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` will load from. |
| `config: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config` | `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config` that defines how the `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` loads data from its `https://developer.android.com/reference/kotlin/androidx/paging/DataSource`. |

### Builder

android

```
<Key : Any, Value : Any> [Builder](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#Builder(androidx.paging.DataSource,kotlin.Int))(
    dataSource: DataSource<Key, Value>,
    pageSize: Int
)
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Create a `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder` with the provided `https://developer.android.com/reference/kotlin/androidx/paging/DataSource` and `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#(androidx.paging.DataSource,kotlin.Int)`.

This method is a convenience for:

```kotlin
PagedList.Builder(dataSource,
    new PagedList.Config.Builder().setPageSize(pageSize).build());
```

| Parameters |
|---|---|
| `dataSource: https://developer.android.com/reference/kotlin/androidx/paging/DataSource<Key, Value>` | `https://developer.android.com/reference/kotlin/androidx/paging/DataSource` the `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` will load from. |
| `pageSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Size of loaded pages when the `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` loads data from its `https://developer.android.com/reference/kotlin/androidx/paging/DataSource`. |

### Builder

android

```
<Key : Any, Value : Any> [Builder](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#Builder(androidx.paging.PagingSource,androidx.paging.PagingSource.LoadResult.Page,androidx.paging.PagedList.Config))(
    pagingSource: PagingSource<Key, Value>,
    initialPage: PagingSource.LoadResult.Page<Key, Value>,
    config: PagedList.Config
)
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Create a `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder` with the provided `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`, initial `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource.LoadResult.Page`, and `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config`.

| Parameters |
|---|---|
| `pagingSource: https://developer.android.com/reference/kotlin/androidx/paging/PagingSource<Key, Value>` | `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource` the `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` will load from. |
| `initialPage: https://developer.android.com/reference/kotlin/androidx/paging/PagingSource.LoadResult.Page<Key, Value>` | Initial page loaded from the `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`. |
| `config: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config` | `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Config` that defines how the `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` loads data from its `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`. |

### Builder

android

```
<Key : Any, Value : Any> [Builder](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#Builder(androidx.paging.PagingSource,androidx.paging.PagingSource.LoadResult.Page,kotlin.Int))(
    pagingSource: PagingSource<Key, Value>,
    initialPage: PagingSource.LoadResult.Page<Key, Value>,
    pageSize: Int
)
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Create a `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder` with the provided `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`, initial `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource.LoadResult.Page`, and `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#(androidx.paging.PagingSource,androidx.paging.PagingSource.LoadResult.Page,kotlin.Int)`.

This method is a convenience for:

```kotlin
PagedList.Builder(
    pagingSource,
    page,
    PagedList.Config.Builder().setPageSize(pageSize).build()
)
```

| Parameters |
|---|---|
| `pagingSource: https://developer.android.com/reference/kotlin/androidx/paging/PagingSource<Key, Value>` | `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource` the `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` will load from. |
| `initialPage: https://developer.android.com/reference/kotlin/androidx/paging/PagingSource.LoadResult.Page<Key, Value>` | Initial page loaded from the `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`. |
| `pageSize: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Size of loaded pages when the `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` loads data from its `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`. |

## Public functions

### build

android Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
fun [build](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#build())(): PagedList<Value>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Creates a `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` with the given parameters.

This call will dispatch the `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`'s loadInitial method immediately on the current thread, and block the current on the result. This method should always be called on a worker thread to prevent blocking the main thread.

It's fine to create a `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` with an async `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource` on the main thread, such as in the constructor of a ViewModel. An async network load won't block the initial call to the Load function. For a synchronous `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource` such as one created from a Room database, a `LiveData<PagedList>` can be safely constructed with `https://developer.android.com/reference/kotlin/androidx/paging/LivePagedListBuilder` on the main thread, since actual construction work is deferred, and done on a background thread.

While `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#build()` will always return a `https://developer.android.com/reference/kotlin/androidx/paging/PagedList`, it's important to note that the `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` initial load may fail to acquire data from the `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`. This can happen for example if the `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource` is invalidated during its initial load. If this happens, the `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` will be immediately `https://developer.android.com/reference/kotlin/androidx/paging/PagedList#isDetached()`, and you can retry construction (including setting a new `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`).

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList<Value>` | The newly constructed `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` |

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#notifyDispatcher()` or `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#fetchDispatcher()` are not set. |

### setBoundaryCallback

android Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
fun [setBoundaryCallback](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setBoundaryCallback(androidx.paging.PagedList.BoundaryCallback))(
    boundaryCallback: PagedList.BoundaryCallback<Value>?
): PagedList.Builder<Key, Value>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

The `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback` for out of data events.

Pass a `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback` to listen to when the `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` runs out of data to load.

| Parameters |
|---|---|
| `boundaryCallback: https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback<Value>?` | `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.BoundaryCallback` for listening to out-of-data events. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder<Key, Value>` | this |

### setCoroutineScope

android Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
fun [setCoroutineScope](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setCoroutineScope(kotlinx.coroutines.CoroutineScope))(coroutineScope: CoroutineScope): PagedList.Builder<Key, Value>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Set the `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/index.html` that page loads should be launched within.

The set `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setCoroutineScope(kotlinx.coroutines.CoroutineScope)` allows a `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource` to cancel running load operations when the results are no longer needed - for example, when the containing Activity is destroyed.

Defaults to `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-global-scope/index.html`.

| Parameters |
|---|---|
| `coroutineScope: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/index.html` |   |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder<Key, Value>` | this |

### setFetchDispatcher

android Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
fun [setFetchDispatcher](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setFetchDispatcher(kotlinx.coroutines.CoroutineDispatcher))(fetchDispatcher: CoroutineDispatcher): PagedList.Builder<Key, Value>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

The `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html` used to fetch additional pages from the `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`.

Does not affect initial load, which will be done immediately on whichever thread the `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` is created on.

| Parameters |
|---|---|
| `fetchDispatcher: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html` | `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html` used to fetch from `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`s, generally a background thread pool for e.g. I/O or network loading. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder<Key, Value>` | this |

### setFetchExecutor

android Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
fun [setFetchExecutor](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setFetchExecutor(java.util.concurrent.Executor))(fetchExecutor: Executor): PagedList.Builder<Key, Value>
```

> [!CAUTION]
> **This function is deprecated.**   
> Passing an executor will cause it get wrapped as a CoroutineDispatcher, consider passing a CoroutineDispatcher directly, use this instead:
>
> ```kotlin
> setFetchDispatcher(fetchExecutor.asCoroutineDispatcher())
> ```

The `https://developer.android.com/reference/java/util/concurrent/Executor.html` used to fetch additional pages from the `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`.

Does not affect initial load, which will be done immediately on whichever thread the `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` is created on.

| Parameters |
|---|---|
| `fetchExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html` | `https://developer.android.com/reference/java/util/concurrent/Executor.html` used to fetch from `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource`s, generally a background thread pool for e.g. I/O or network loading. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder<Key, Value>` | this |

### setInitialKey

android Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
fun [setInitialKey](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setInitialKey(kotlin.Any))(initialKey: Key?): PagedList.Builder<Key, Value>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

Sets the initial key the `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource` should load around as part of initialization.

| Parameters |
|---|---|
| `initialKey: Key?` | Key the `https://developer.android.com/reference/kotlin/androidx/paging/PagingSource` should load around as part of initialization. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder<Key, Value>` | this |

### setNotifyDispatcher

android Added in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
fun [setNotifyDispatcher](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setNotifyDispatcher(kotlinx.coroutines.CoroutineDispatcher))(notifyDispatcher: CoroutineDispatcher): PagedList.Builder<Key, Value>
```

> [!CAUTION]
> **This function is deprecated.**   
> PagedList is deprecated and has been replaced by PagingData

The `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html` defining where page loading updates are dispatched.

| Parameters |
|---|---|
| `notifyDispatcher: https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html` | `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html` that receives `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` updates, and where `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Callback` calls are dispatched. Generally, this is the ui/main thread. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder<Key, Value>` | this |

### setNotifyExecutor

android Added in [2.0.0](https://developer.android.com/jetpack/androidx/releases/paging#2.0.0) Deprecated in [3.0.0](https://developer.android.com/jetpack/androidx/releases/paging#3.0.0)

```
fun [setNotifyExecutor](https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder#setNotifyExecutor(java.util.concurrent.Executor))(notifyExecutor: Executor): PagedList.Builder<Key, Value>
```

> [!CAUTION]
> **This function is deprecated.**   
> Passing an executor will cause it get wrapped as a CoroutineDispatcher, consider passing a CoroutineDispatcher directly, use this instead:
>
> ```kotlin
> setNotifyDispatcher(fetchExecutor.asCoroutineDispatcher())
> ```

The `https://developer.android.com/reference/java/util/concurrent/Executor.html` defining where page loading updates are dispatched.

| Parameters |
|---|---|
| `notifyExecutor: https://developer.android.com/reference/java/util/concurrent/Executor.html` | `https://developer.android.com/reference/java/util/concurrent/Executor.html` that receives `https://developer.android.com/reference/kotlin/androidx/paging/PagedList` updates, and where `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Callback` calls are dispatched. Generally, this is the ui/main thread. |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/paging/PagedList.Builder<Key, Value>` | this |