# 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)

*** ** * ** ***


```
public final class PagedList.Builder<Key extends Object, Value extends Object>
```

<br />

*** ** * ** ***

> [!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:
>
> ```
> Pager.flow
> ```

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

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

A `https://developer.android.com/reference/androidx/paging/PagedList` queries initial data from its `https://developer.android.com/reference/androidx/paging/PagingSource` during construction, to avoid empty `https://developer.android.com/reference/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/androidx/paging/LivePagedListBuilder` does this creation on a background thread automatically, if you want to receive a `LiveData<PagedList<...>>`.

| Parameters |
|---|---|
| `<Key extends https://developer.android.com/reference/java/lang/Object.html>` | Type of key used to load data from the `https://developer.android.com/reference/androidx/paging/PagingSource`. |
| `<Value extends https://developer.android.com/reference/java/lang/Object.html>` | Type of items held and loaded by the `https://developer.android.com/reference/androidx/paging/PagedList`. |

## Summary

| ### Public constructors |
|---|
| `<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html> [Builder](https://developer.android.com/reference/androidx/paging/PagedList.Builder#Builder(androidx.paging.DataSource,androidx.paging.PagedList.Config))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> dataSource, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Config config )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html> [Builder](https://developer.android.com/reference/androidx/paging/PagedList.Builder#Builder(androidx.paging.DataSource,kotlin.Int))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> dataSource, int pageSize )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html> [Builder](https://developer.android.com/reference/androidx/paging/PagedList.Builder#Builder(androidx.paging.PagingSource,androidx.paging.PagingSource.LoadResult.Page,androidx.paging.PagedList.Config))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagingSource<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> pagingSource, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagingSource.LoadResult.Page<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> initialPage, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagedList.Config config )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |
| `<Key extends https://developer.android.com/reference/java/lang/Object.html, Value extends https://developer.android.com/reference/java/lang/Object.html> [Builder](https://developer.android.com/reference/androidx/paging/PagedList.Builder#Builder(androidx.paging.PagingSource,androidx.paging.PagingSource.LoadResult.Page,kotlin.Int))( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagingSource<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> pagingSource, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagingSource.LoadResult.Page<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> initialPage, int pageSize )` **This method is deprecated.** PagedList is deprecated and has been replaced by PagingData |

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

## Public constructors

### Builder

```
public <Key extends Object, Value extends Object> [Builder](https://developer.android.com/reference/androidx/paging/PagedList.Builder#Builder(androidx.paging.DataSource,androidx.paging.PagedList.Config))(
    @NonNull DataSource<@NonNull Key, @NonNull Value> dataSource,
    @NonNull PagedList.Config config
)
```

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

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

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

### Builder

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

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

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

This method is a convenience for:

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/DataSource<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> dataSource` | `https://developer.android.com/reference/androidx/paging/DataSource` the `https://developer.android.com/reference/androidx/paging/PagedList` will load from. |
| `int pageSize` | Size of loaded pages when the `https://developer.android.com/reference/androidx/paging/PagedList` loads data from its `https://developer.android.com/reference/androidx/paging/DataSource`. |

### Builder

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

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

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

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

### Builder

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

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

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

This method is a convenience for:

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

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagingSource<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> pagingSource` | `https://developer.android.com/reference/androidx/paging/PagingSource` the `https://developer.android.com/reference/androidx/paging/PagedList` will load from. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/paging/PagingSource.LoadResult.Page<@https://developer.android.com/reference/androidx/annotation/NonNull Key, @https://developer.android.com/reference/androidx/annotation/NonNull Value> initialPage` | Initial page loaded from the `https://developer.android.com/reference/androidx/paging/PagingSource`. |
| `int pageSize` | Size of loaded pages when the `https://developer.android.com/reference/androidx/paging/PagedList` loads data from its `https://developer.android.com/reference/androidx/paging/PagingSource`. |

## Public methods

### build

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)

```
public final @NonNull PagedList<@NonNull Value> [build](https://developer.android.com/reference/androidx/paging/PagedList.Builder#build())()
```

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

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

This call will dispatch the `https://developer.android.com/reference/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/androidx/paging/PagedList` with an async `https://developer.android.com/reference/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/androidx/paging/PagingSource` such as one created from a Room database, a `LiveData<PagedList>` can be safely constructed with `https://developer.android.com/reference/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/androidx/paging/PagedList.Builder#build()` will always return a `https://developer.android.com/reference/androidx/paging/PagedList`, it's important to note that the `https://developer.android.com/reference/androidx/paging/PagedList` initial load may fail to acquire data from the `https://developer.android.com/reference/androidx/paging/PagingSource`. This can happen for example if the `https://developer.android.com/reference/androidx/paging/PagingSource` is invalidated during its initial load. If this happens, the `https://developer.android.com/reference/androidx/paging/PagedList` will be immediately `https://developer.android.com/reference/androidx/paging/PagedList#isDetached()`, and you can retry construction (including setting a new `https://developer.android.com/reference/androidx/paging/PagingSource`).

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

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

### setBoundaryCallback

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)

```
public final @NonNull PagedList.Builder<@NonNull Key, @NonNull Value> [setBoundaryCallback](https://developer.android.com/reference/androidx/paging/PagedList.Builder#setBoundaryCallback(androidx.paging.PagedList.BoundaryCallback))(
    PagedList.BoundaryCallback<@NonNull Value> boundaryCallback
)
```

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

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

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

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

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

### setCoroutineScope

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)

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

> [!CAUTION]
> **This method 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/androidx/paging/PagedList.Builder#setCoroutineScope(kotlinx.coroutines.CoroutineScope)` allows a `https://developer.android.com/reference/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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/index.html coroutineScope` |   |

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

### setFetchDispatcher

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)

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

> [!CAUTION]
> **This method 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/androidx/paging/PagingSource`.

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

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

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

### setFetchExecutor

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)

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

> [!CAUTION]
> **This method is deprecated.**   
> Passing an executor will cause it get wrapped as a CoroutineDispatcher, consider passing a CoroutineDispatcher directly, use this instead:
>
> ```
> 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/androidx/paging/PagingSource`.

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

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

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

### setInitialKey

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)

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

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

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

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

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

### setNotifyDispatcher

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)

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

> [!CAUTION]
> **This method 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 |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html notifyDispatcher` | `https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-dispatcher/index.html` that receives `https://developer.android.com/reference/androidx/paging/PagedList` updates, and where `https://developer.android.com/reference/androidx/paging/PagedList.Callback` calls are dispatched. Generally, this is the ui/main thread. |

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

### setNotifyExecutor

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)

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

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

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

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

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