Creates a PagedList with the given parameters. This call will dispatch the DataSource's loadInitial method immediately. If a DataSource posts all of its work (e.g. to a network thread), the PagedList will be immediately created as empty, and grow to its initial size when the init
()
| 374 | * @return The newly constructed PagedList |
| 375 | */ |
| 376 | @WorkerThread |
| 377 | @NonNull |
| 378 | public PagedList<Value> build() { |
| 379 | // TODO: define defaults, once they can be used in module without android dependency |
| 380 | if (mNotifyExecutor == null) { |
| 381 | throw new IllegalArgumentException("MainThreadExecutor required"); |
| 382 | } |
| 383 | if (mFetchExecutor == null) { |
| 384 | throw new IllegalArgumentException("BackgroundThreadExecutor required"); |
| 385 | } |
| 386 | |
| 387 | //noinspection unchecked |
| 388 | return PagedList.create( |
| 389 | mDataSource, |
| 390 | mNotifyExecutor, |
| 391 | mFetchExecutor, |
| 392 | mBoundaryCallback, |
| 393 | mConfig, |
| 394 | mInitialKey); |
| 395 | } |
| 396 | } |
| 397 | |
| 398 | /** |
no test coverage detected