# RxPagedListBuilder

Summary:[Ctors](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#pubctors)\|[Methods](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#inhmethods)  

# RxPagedListBuilder

| The`android.arch`Architecture Components packages are no longer maintained. They have been superseded by the corresponding[androidx.\*](https://developer.android.com/jetpack/androidx/migrate)packages. See[androidx.paging.RxPagedListBuilder](https://developer.android.com/reference/androidx/paging/RxPagedListBuilder)instead.

`
public

final

class
RxPagedListBuilder
`  
`

extends Object


``


`

|---|------------------------------------------------------|
| java.lang.Object                                        ||
| ↳ | android.arch.paging.RxPagedListBuilder\<Key, Value\> |

<br />

*** ** * ** ***

Builder for`Observable<PagedList>`or`Flowable<PagedList>`, given a[DataSource.Factory](https://developer.android.com/reference/android/arch/paging/DataSource.Factory)and a[PagedList.Config](https://developer.android.com/reference/android/arch/paging/PagedList.Config).

The required parameters are in the constructor, so you can simply construct and build, or optionally enable extra features (such as initial load key, or BoundaryCallback).

The returned observable/flowable will already be subscribed on the[setFetchScheduler(Scheduler)](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#setFetchScheduler(io.reactivex.Scheduler)), and will perform all loading on that scheduler. It will already be observed on[setNotifyScheduler(Scheduler)](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#setNotifyScheduler(io.reactivex.Scheduler)), and will dispatch new PagedLists, as well as their updates to that scheduler.

## Summary

|                                                                                                                                                                                                                                                 ### Public constructors                                                                                                                                                                                                                                                 ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[RxPagedListBuilder](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#RxPagedListBuilder(android.arch.paging.DataSource.Factory<Key, Value>, android.arch.paging.PagedList.Config))`(`[Factory](https://developer.android.com/reference/android/arch/paging/DataSource.Factory)`<Key, Value> dataSourceFactory, `[PagedList.Config](https://developer.android.com/reference/android/arch/paging/PagedList.Config)` config) ` Creates a RxPagedListBuilder with required parameters. |
| ` `[RxPagedListBuilder](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#RxPagedListBuilder(android.arch.paging.DataSource.Factory<Key, Value>, int))`(`[Factory](https://developer.android.com/reference/android/arch/paging/DataSource.Factory)`<Key, Value> dataSourceFactory, int pageSize) ` Creates a RxPagedListBuilder with required parameters.                                                                                                                               |

|                                                                                                                                                                                                                                                                                                                                      ### Public methods                                                                                                                                                                                                                                                                                                                                      ||
|-----------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` Flowable<`[PagedList](https://developer.android.com/reference/android/arch/paging/PagedList)`<Value>>`              | ` `[buildFlowable](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#buildFlowable(io.reactivex.BackpressureStrategy))`(BackpressureStrategy backpressureStrategy) ` Constructs a`Flowable<PagedList>`.                                                                                                                                                                                                                                                                                                                                  |
| ` Observable<`[PagedList](https://developer.android.com/reference/android/arch/paging/PagedList)`<Value>>`            | ` `[buildObservable](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#buildObservable())`() ` Constructs a`Observable<PagedList>`.                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` `[RxPagedListBuilder](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder)`<Key, Value>` | ` `[setBoundaryCallback](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#setBoundaryCallback(android.arch.paging.PagedList.BoundaryCallback<Value>))`(`[BoundaryCallback](https://developer.android.com/reference/android/arch/paging/PagedList.BoundaryCallback)`<Value> boundaryCallback) ` Sets a[PagedList.BoundaryCallback](https://developer.android.com/reference/android/arch/paging/PagedList.BoundaryCallback)on each PagedList created, typically used to load additional data from network when paging from local storage. |
| ` `[RxPagedListBuilder](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder)`<Key, Value>` | ` `[setFetchScheduler](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#setFetchScheduler(io.reactivex.Scheduler))`(Scheduler scheduler) ` Sets scheduler which will be used for background fetching of PagedLists, as well as on-demand fetching of pages inside.                                                                                                                                                                                                                                                                      |
| ` `[RxPagedListBuilder](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder)`<Key, Value>` | ` `[setInitialLoadKey](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#setInitialLoadKey(Key))`(Key key) ` First loading key passed to the first PagedList/DataSource.                                                                                                                                                                                                                                                                                                                                                                 |
| ` `[RxPagedListBuilder](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder)`<Key, Value>` | ` `[setNotifyScheduler](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#setNotifyScheduler(io.reactivex.Scheduler))`(Scheduler scheduler) ` Sets scheduler which will be used for observing new PagedLists, as well as loading updates within the PagedLists.                                                                                                                                                                                                                                                                          |

| ### Inherited methods |
|-----------------------|---|
| From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||

## Public constructors

### RxPagedListBuilder

```
RxPagedListBuilder (Factory<Key, Value> dataSourceFactory, 
                PagedList.Config config)
```

Creates a RxPagedListBuilder with required parameters.

<br />

|                                         Parameters                                          ||
|---------------------|------------------------------------------------------------------------|
| `dataSourceFactory` | `Factory`: DataSource factory providing DataSource generations. <br /> |
| `config`            | `PagedList.Config`: Paging configuration. <br />                       |

### RxPagedListBuilder

```
RxPagedListBuilder (Factory<Key, Value> dataSourceFactory, 
                int pageSize)
```

Creates a RxPagedListBuilder with required parameters.

This method is a convenience for:  

```
 RxPagedListBuilder(dataSourceFactory,
         new PagedList.Config.Builder().setPageSize(pageSize).build())
 
```

<br />

<br />

|                                         Parameters                                          ||
|---------------------|------------------------------------------------------------------------|
| `dataSourceFactory` | `Factory`: DataSource.Factory providing DataSource generations. <br /> |
| `pageSize`          | `int`: Size of pages to load. <br />                                   |

## Public methods

### buildFlowable

```
Flowable<PagedList<Value>> buildFlowable (BackpressureStrategy backpressureStrategy)
```

Constructs a`Flowable<PagedList>`. The returned Observable will already be observed on the[notify scheduler](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#setNotifyScheduler(io.reactivex.Scheduler)), and subscribed on the[fetch scheduler](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#setFetchScheduler(io.reactivex.Scheduler)).

<br />

|                                              Parameters                                              ||
|------------------------|------------------------------------------------------------------------------|
| `backpressureStrategy` | `BackpressureStrategy`: BackpressureStrategy for the Flowable to use. <br /> |

|                                                                  Returns                                                                   ||
|---------------------------------------------------------------------------------------------------------|-----------------------------------|
| `Flowable<`[PagedList](https://developer.android.com/reference/android/arch/paging/PagedList)`<Value>>` | The Flowable of PagedLists <br /> |

### buildObservable

```
Observable<PagedList<Value>> buildObservable ()
```

Constructs a`Observable<PagedList>`.

The returned Observable will already be observed on the[notify scheduler](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#setNotifyScheduler(io.reactivex.Scheduler)), and subscribed on the[fetch scheduler](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder#setFetchScheduler(io.reactivex.Scheduler)).

<br />

|                                                                    Returns                                                                     ||
|-----------------------------------------------------------------------------------------------------------|-------------------------------------|
| `Observable<`[PagedList](https://developer.android.com/reference/android/arch/paging/PagedList)`<Value>>` | The Observable of PagedLists <br /> |

### setBoundaryCallback

```
RxPagedListBuilder<Key, Value> setBoundaryCallback (BoundaryCallback<Value> boundaryCallback)
```

Sets a[PagedList.BoundaryCallback](https://developer.android.com/reference/android/arch/paging/PagedList.BoundaryCallback)on each PagedList created, typically used to load additional data from network when paging from local storage.

Pass a BoundaryCallback to listen to when the PagedList runs out of data to load. If this method is not called, or`null`is passed, you will not be notified when each DataSource runs out of data to provide to its PagedList.

If you are paging from a DataSource.Factory backed by local storage, you can set a BoundaryCallback to know when there is no more information to page from local storage. This is useful to page from the network when local storage is a cache of network data.

Note that when using a BoundaryCallback with a`Observable<PagedList>`, method calls on the callback may be dispatched multiple times - one for each PagedList/DataSource pair. If loading network data from a BoundaryCallback, you should prevent multiple dispatches of the same method from triggering multiple simultaneous network loads.

<br />

|                                                 Parameters                                                  ||
|--------------------|-----------------------------------------------------------------------------------------|
| `boundaryCallback` | `BoundaryCallback`: The boundary callback for listening to PagedList load state. <br /> |

|                                                             Returns                                                             ||
|--------------------------------------------------------------------------------------------------------------------|-------------|
| [RxPagedListBuilder](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder)`<Key, Value>` | this <br /> |

### setFetchScheduler

```
RxPagedListBuilder<Key, Value> setFetchScheduler (Scheduler scheduler)
```

Sets scheduler which will be used for background fetching of PagedLists, as well as on-demand fetching of pages inside.

<br />

|                                  Parameters                                   ||
|-------------|------------------------------------------------------------------|
| `scheduler` | `Scheduler`: Scheduler for background DataSource loading. <br /> |

|                                                             Returns                                                             ||
|--------------------------------------------------------------------------------------------------------------------|-------------|
| [RxPagedListBuilder](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder)`<Key, Value>` | this <br /> |

### setInitialLoadKey

```
RxPagedListBuilder<Key, Value> setInitialLoadKey (Key key)
```

First loading key passed to the first PagedList/DataSource.

When a new PagedList/DataSource pair is created after the first, it acquires a load key from the previous generation so that data is loaded around the position already being observed.

<br />

|                                   Parameters                                    ||
|-------|--------------------------------------------------------------------------|
| `key` | `Key`: Initial load key passed to the first PagedList/DataSource. <br /> |

|                                                             Returns                                                             ||
|--------------------------------------------------------------------------------------------------------------------|-------------|
| [RxPagedListBuilder](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder)`<Key, Value>` | this <br /> |

### setNotifyScheduler

```
RxPagedListBuilder<Key, Value> setNotifyScheduler (Scheduler scheduler)
```

Sets scheduler which will be used for observing new PagedLists, as well as loading updates within the PagedLists.

The built observable will be[observed on](https://developer.android.com/reference/io/reactivex/Observable#observeOn(io.reactivex.Scheduler))this scheduler, so that the thread receiving PagedLists will also receive the internal updates to the PagedList.

<br />

|                                  Parameters                                   ||
|-------------|------------------------------------------------------------------|
| `scheduler` | `Scheduler`: Scheduler for background DataSource loading. <br /> |

|                                                             Returns                                                             ||
|--------------------------------------------------------------------------------------------------------------------|-------------|
| [RxPagedListBuilder](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder)`<Key, Value>` | this <br /> |

-

  ## Interfaces

  - [DataSource.InvalidatedCallback](https://developer.android.com/reference/android/arch/paging/DataSource.InvalidatedCallback)
-

  ## Classes

  - [AsyncPagedListDiffer](https://developer.android.com/reference/android/arch/paging/AsyncPagedListDiffer)
  - [DataSource](https://developer.android.com/reference/android/arch/paging/DataSource)
  - [DataSource.Factory](https://developer.android.com/reference/android/arch/paging/DataSource.Factory)
  - [ItemKeyedDataSource](https://developer.android.com/reference/android/arch/paging/ItemKeyedDataSource)
  - [ItemKeyedDataSource.LoadCallback](https://developer.android.com/reference/android/arch/paging/ItemKeyedDataSource.LoadCallback)
  - [ItemKeyedDataSource.LoadInitialCallback](https://developer.android.com/reference/android/arch/paging/ItemKeyedDataSource.LoadInitialCallback)
  - [ItemKeyedDataSource.LoadInitialParams](https://developer.android.com/reference/android/arch/paging/ItemKeyedDataSource.LoadInitialParams)
  - [ItemKeyedDataSource.LoadParams](https://developer.android.com/reference/android/arch/paging/ItemKeyedDataSource.LoadParams)
  - [LivePagedListBuilder](https://developer.android.com/reference/android/arch/paging/LivePagedListBuilder)
  - [PagedList](https://developer.android.com/reference/android/arch/paging/PagedList)
  - [PagedList.BoundaryCallback](https://developer.android.com/reference/android/arch/paging/PagedList.BoundaryCallback)
  - [PagedList.Builder](https://developer.android.com/reference/android/arch/paging/PagedList.Builder)
  - [PagedList.Callback](https://developer.android.com/reference/android/arch/paging/PagedList.Callback)
  - [PagedList.Config](https://developer.android.com/reference/android/arch/paging/PagedList.Config)
  - [PagedList.Config.Builder](https://developer.android.com/reference/android/arch/paging/PagedList.Config.Builder)
  - [PagedListAdapter](https://developer.android.com/reference/android/arch/paging/PagedListAdapter)
  - [PageKeyedDataSource](https://developer.android.com/reference/android/arch/paging/PageKeyedDataSource)
  - [PageKeyedDataSource.LoadCallback](https://developer.android.com/reference/android/arch/paging/PageKeyedDataSource.LoadCallback)
  - [PageKeyedDataSource.LoadInitialCallback](https://developer.android.com/reference/android/arch/paging/PageKeyedDataSource.LoadInitialCallback)
  - [PageKeyedDataSource.LoadInitialParams](https://developer.android.com/reference/android/arch/paging/PageKeyedDataSource.LoadInitialParams)
  - [PageKeyedDataSource.LoadParams](https://developer.android.com/reference/android/arch/paging/PageKeyedDataSource.LoadParams)
  - [PositionalDataSource](https://developer.android.com/reference/android/arch/paging/PositionalDataSource)
  - [PositionalDataSource.LoadInitialCallback](https://developer.android.com/reference/android/arch/paging/PositionalDataSource.LoadInitialCallback)
  - [PositionalDataSource.LoadInitialParams](https://developer.android.com/reference/android/arch/paging/PositionalDataSource.LoadInitialParams)
  - [PositionalDataSource.LoadRangeCallback](https://developer.android.com/reference/android/arch/paging/PositionalDataSource.LoadRangeCallback)
  - [PositionalDataSource.LoadRangeParams](https://developer.android.com/reference/android/arch/paging/PositionalDataSource.LoadRangeParams)
  - [RxPagedListBuilder](https://developer.android.com/reference/android/arch/paging/RxPagedListBuilder)