| <html devsite="true"> |
| <head> |
| <title>PageKeyedDataSource</title> |
| {% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} |
| {% include "_shared/_reference-head-tags.html" %} |
| </head> |
| <body> |
| <div id="metadata-info-block"></div> |
| <h1>PageKeyedDataSource</h1> |
| <p> |
| <pre>public abstract class <a href="/reference/androidx/paging/PageKeyedDataSource.html">PageKeyedDataSource</a><Key extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>, Value extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> extends <a href="/reference/androidx/paging/DataSource.html">DataSource</a></pre> |
| </p> |
| <div class="devsite-table-wrapper"> |
| <table class="jd-inheritance-table"> |
| <tbody> |
| <tr> |
| <td colspan="3"><a href="https://developer.android.com/reference/java/lang/Object.html">java.lang.Object</a></td> |
| </tr> |
| <tr> |
| <td class="jd-inheritance-space"> ↳</td> |
| <td colspan="2"><a href="/reference/androidx/paging/DataSource.html">androidx.paging.DataSource</a></td> |
| </tr> |
| <tr> |
| <td> </td> |
| <td class="jd-inheritance-space"> ↳</td> |
| <td colspan="1"><a href="/reference/androidx/paging/PageKeyedDataSource.html">androidx.paging.PageKeyedDataSource</a></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <hr> |
| <aside class="caution"><strong>This class is deprecated.</strong><br>PageKeyedDataSource is deprecated and has been replaced by PagingSource</aside> |
| <p>Incremental data loader for page-keyed content, where requests return keys for next/previous pages.</p> |
| <p>Implement a <code><a href="/reference/androidx/paging/DataSource.html">DataSource</a></code> using <code><a href="/reference/androidx/paging/PageKeyedDataSource.html">PageKeyedDataSource</a></code> if you need to use data from page <code>N - 1</code> to load page <code>N</code>. This is common, for example, in network APIs that include a next/previous link or key with each page load.</p> |
| <p>The <code>InMemoryByPageRepository</code> in the <a href="https://github.com/googlesamples/android-architecture-components/blob/master/PagingWithNetworkSample/README.md">PagingWithNetworkSample</a> shows how to implement a network PageKeyedDataSource using <a href="https://square.github.io/retrofit/">Retrofit</a>, while handling swipe-to-refresh, network errors, and retry.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code><Key extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>></code></td> |
| <td> |
| <p>Type of data used to query Value types out of the <code><a href="/reference/androidx/paging/DataSource.html">DataSource</a></code>.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code><Value extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>></code></td> |
| <td> |
| <p>Type of items being loaded by the <code><a href="/reference/androidx/paging/DataSource.html">DataSource</a></code>.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <h2>Summary</h2> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%"><h3>Nested types</h3></th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td> |
| <div><code>public abstract class <a href="/reference/androidx/paging/PageKeyedDataSource.LoadCallback.html">PageKeyedDataSource.LoadCallback</a><Key extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>, Value extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>></code></div> |
| <p>Callback for <code><a href="/reference/androidx/paging/PageKeyedDataSource.html#loadBefore(androidx.paging.PageKeyedDataSource.LoadParams)">loadBefore</a></code> and <code><a href="/reference/androidx/paging/PageKeyedDataSource.html#loadAfter(androidx.paging.PageKeyedDataSource.LoadParams)">loadAfter</a></code> to return data.</p> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <div><code>public abstract class <a href="/reference/androidx/paging/PageKeyedDataSource.LoadInitialCallback.html">PageKeyedDataSource.LoadInitialCallback</a><Key extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>, Value extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>></code></div> |
| <p>Callback for <code><a href="/reference/androidx/paging/PageKeyedDataSource.html#loadInitial(androidx.paging.PageKeyedDataSource.LoadInitialParams)">loadInitial</a></code> to return data and, optionally, position/count information.</p> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <div><code>public class <a href="/reference/androidx/paging/PageKeyedDataSource.LoadInitialParams.html">PageKeyedDataSource.LoadInitialParams</a><Key extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>></code></div> |
| <p>Holder object for inputs to <code><a href="/reference/androidx/paging/PageKeyedDataSource.html#loadInitial(androidx.paging.PageKeyedDataSource.LoadInitialParams)">loadInitial</a></code>.</p> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <div><code>public class <a href="/reference/androidx/paging/PageKeyedDataSource.LoadParams.html">PageKeyedDataSource.LoadParams</a><Key extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>></code></div> |
| <p>Holder object for inputs to <code><a href="/reference/androidx/paging/PageKeyedDataSource.html#loadBefore(androidx.paging.PageKeyedDataSource.LoadParams)">loadBefore</a></code> and <code><a href="/reference/androidx/paging/PageKeyedDataSource.html#loadAfter(androidx.paging.PageKeyedDataSource.LoadParams)">loadAfter</a></code>.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%"><h3>Public constructors</h3></th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td> |
| <div><code><Key extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>, Value extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/paging/PageKeyedDataSource.html#PageKeyedDataSource()">PageKeyedDataSource</a>()</code></div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%"><h3>Public methods</h3></th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code>abstract void</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/paging/PageKeyedDataSource.html#loadAfter(androidx.paging.PageKeyedDataSource.LoadParams,androidx.paging.PageKeyedDataSource.LoadCallback)">loadAfter</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadParams.html">PageKeyedDataSource.LoadParams</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key> params,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadCallback.html">PageKeyedDataSource.LoadCallback</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value> callback<br>)</code></div> |
| <p>Append page with the key specified by <code><a href="/reference/androidx/paging/PageKeyedDataSource.LoadParams.html#key()">LoadParams.key</a></code>.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code>abstract void</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/paging/PageKeyedDataSource.html#loadBefore(androidx.paging.PageKeyedDataSource.LoadParams,androidx.paging.PageKeyedDataSource.LoadCallback)">loadBefore</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadParams.html">PageKeyedDataSource.LoadParams</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key> params,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadCallback.html">PageKeyedDataSource.LoadCallback</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value> callback<br>)</code></div> |
| <p>Prepend page with the key specified by <code><a href="/reference/androidx/paging/PageKeyedDataSource.LoadParams.html#key()">LoadParams.key</a></code>.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code>abstract void</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/paging/PageKeyedDataSource.html#loadInitial(androidx.paging.PageKeyedDataSource.LoadInitialParams,androidx.paging.PageKeyedDataSource.LoadInitialCallback)">loadInitial</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadInitialParams.html">PageKeyedDataSource.LoadInitialParams</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key> params,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadInitialCallback.html">PageKeyedDataSource.LoadInitialCallback</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value> callback<br>)</code></div> |
| <p>Load initial data.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code>final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.html">PageKeyedDataSource</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue></code></td> |
| <td> |
| <div><code><ToValue extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/paging/PageKeyedDataSource.html#map(androidx.arch.core.util.Function)">map</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/arch/core/util/Function.html">Function</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue> function<br>)</code></div> |
| <p>Applies the given function to each value emitted by the DataSource.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code>final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.html">PageKeyedDataSource</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue></code></td> |
| <td> |
| <div><code><ToValue extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/paging/PageKeyedDataSource.html#map(kotlin.Function1)">map</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1<@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue> function<br>)</code></div> |
| <p>Applies the given function to each value emitted by the DataSource.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code>final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.html">PageKeyedDataSource</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue></code></td> |
| <td> |
| <div><code><ToValue extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/paging/PageKeyedDataSource.html#mapByPage(androidx.arch.core.util.Function)">mapByPage</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/arch/core/util/Function.html">Function</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value>, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue>> function<br>)</code></div> |
| <p>Applies the given function to each value emitted by the DataSource.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code>final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.html">PageKeyedDataSource</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue></code></td> |
| <td> |
| <div><code><ToValue extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/paging/PageKeyedDataSource.html#mapByPage(kotlin.Function1)">mapByPage</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1<@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value>, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue>> function<br>)</code></div> |
| <p>Applies the given function to each value emitted by the DataSource.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive" id="inhmethods"> |
| <thead> |
| <tr> |
| <th colspan="100%"><h3>Inherited fields</h3></th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><devsite-expandable><span class="expand-control">From <a href="/reference/androidx/paging/DataSource.html">androidx.paging.DataSource</a></span> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code>boolean</code></td> |
| <td> |
| <div><code><a href="/reference/androidx/paging/DataSource.html#isInvalid()">isInvalid</a></code></div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </devsite-expandable> </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive" id="inhmethods"> |
| <thead> |
| <tr> |
| <th colspan="100%"><h3>Inherited methods</h3></th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td><devsite-expandable><span class="expand-control">From <a href="/reference/androidx/paging/DataSource.html">androidx.paging.DataSource</a></span> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code>void</code></td> |
| <td> |
| <div><code>@<a href="/reference/androidx/annotation/AnyThread.html">AnyThread</a><br><a href="/reference/androidx/paging/DataSource.html#addInvalidatedCallback(androidx.paging.DataSource.InvalidatedCallback)">addInvalidatedCallback</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/DataSource.InvalidatedCallback.html">DataSource.InvalidatedCallback</a> onInvalidatedCallback<br>)</code></div> |
| <p>Add a callback to invoke when the DataSource is first invalidated.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code>void</code></td> |
| <td> |
| <div><code>@<a href="/reference/androidx/annotation/AnyThread.html">AnyThread</a><br><a href="/reference/androidx/paging/DataSource.html#invalidate()">invalidate</a>()</code></div> |
| <p>Signal the data source to stop loading, and notify its callback.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code>void</code></td> |
| <td> |
| <div><code>@<a href="/reference/androidx/annotation/AnyThread.html">AnyThread</a><br><a href="/reference/androidx/paging/DataSource.html#removeInvalidatedCallback(androidx.paging.DataSource.InvalidatedCallback)">removeInvalidatedCallback</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/DataSource.InvalidatedCallback.html">DataSource.InvalidatedCallback</a> onInvalidatedCallback<br>)</code></div> |
| <p>Remove a previously added invalidate callback.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </devsite-expandable> </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="list"> |
| <h2>Public constructors</h2> |
| <div class="api-item"><a name="PageKeyedDataSource--"></a><a name="pagekeyeddatasource"></a> |
| <h3 class="api-name" id="PageKeyedDataSource()">PageKeyedDataSource</h3> |
| <pre class="api-signature no-pretty-print">public <Key extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>, Value extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/paging/PageKeyedDataSource.html#PageKeyedDataSource()">PageKeyedDataSource</a>()</pre> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code><Key extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>></code></td> |
| <td> |
| <p>Type of data used to query Value types out of the <code><a href="/reference/androidx/paging/DataSource.html">DataSource</a></code>.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code><Value extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>></code></td> |
| <td> |
| <p>Type of items being loaded by the <code><a href="/reference/androidx/paging/DataSource.html">DataSource</a></code>.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| </div> |
| <div class="list"> |
| <h2>Public methods</h2> |
| <div class="api-item"><a name="loadAfter(androidx.paging.PageKeyedDataSource.LoadParams, androidx.paging.PageKeyedDataSource.LoadCallback)"></a><a name="loadAfter-androidx.paging.PageKeyedDataSource.LoadParams-androidx.paging.PageKeyedDataSource.LoadCallback-"></a><a name="loadafter"></a> |
| <h3 class="api-name" id="loadAfter(androidx.paging.PageKeyedDataSource.LoadParams,androidx.paging.PageKeyedDataSource.LoadCallback)">loadAfter</h3> |
| <pre class="api-signature no-pretty-print">public abstract void <a href="/reference/androidx/paging/PageKeyedDataSource.html#loadAfter(androidx.paging.PageKeyedDataSource.LoadParams,androidx.paging.PageKeyedDataSource.LoadCallback)">loadAfter</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadParams.html">PageKeyedDataSource.LoadParams</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key> params,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadCallback.html">PageKeyedDataSource.LoadCallback</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value> callback<br>)</pre> |
| <p>Append page with the key specified by <code><a href="/reference/androidx/paging/PageKeyedDataSource.LoadParams.html#key()">LoadParams.key</a></code>.</p> |
| <p>It's valid to return a different list size than the page size if it's easier, e.g. if your backend defines page sizes. It is generally preferred to increase the number loaded than reduce.</p> |
| <p>Data may be passed synchronously during the load method, or deferred and called at a later time. Further loads going down will be blocked until the callback is called.</p> |
| <p>If data cannot be loaded (for example, if the request is invalid, or the data would be stale and inconsistent), it is valid to call <code><a href="/reference/androidx/paging/PageKeyedDataSource.html#invalidate()">invalidate</a></code> to invalidate the data source, and prevent further loading.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadParams.html">PageKeyedDataSource.LoadParams</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key> params</code></td> |
| <td> |
| <p>Parameters for the load, including the key for the new page, and requested load size.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadCallback.html">PageKeyedDataSource.LoadCallback</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value> callback</code></td> |
| <td> |
| <p>Callback that receives loaded data.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="api-item"><a name="loadBefore(androidx.paging.PageKeyedDataSource.LoadParams, androidx.paging.PageKeyedDataSource.LoadCallback)"></a><a name="loadBefore-androidx.paging.PageKeyedDataSource.LoadParams-androidx.paging.PageKeyedDataSource.LoadCallback-"></a><a name="loadbefore"></a> |
| <h3 class="api-name" id="loadBefore(androidx.paging.PageKeyedDataSource.LoadParams,androidx.paging.PageKeyedDataSource.LoadCallback)">loadBefore</h3> |
| <pre class="api-signature no-pretty-print">public abstract void <a href="/reference/androidx/paging/PageKeyedDataSource.html#loadBefore(androidx.paging.PageKeyedDataSource.LoadParams,androidx.paging.PageKeyedDataSource.LoadCallback)">loadBefore</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadParams.html">PageKeyedDataSource.LoadParams</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key> params,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadCallback.html">PageKeyedDataSource.LoadCallback</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value> callback<br>)</pre> |
| <p>Prepend page with the key specified by <code><a href="/reference/androidx/paging/PageKeyedDataSource.LoadParams.html#key()">LoadParams.key</a></code>.</p> |
| <p>It's valid to return a different list size than the page size if it's easier, e.g. if your backend defines page sizes. It is generally preferred to increase the number loaded than reduce.</p> |
| <p>Data may be passed synchronously during the load method, or deferred and called at a later time. Further loads going down will be blocked until the callback is called.</p> |
| <p>If data cannot be loaded (for example, if the request is invalid, or the data would be stale and inconsistent), it is valid to call <code><a href="/reference/androidx/paging/PageKeyedDataSource.html#invalidate()">invalidate</a></code> to invalidate the data source, and prevent further loading.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadParams.html">PageKeyedDataSource.LoadParams</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key> params</code></td> |
| <td> |
| <p>Parameters for the load, including the key for the new page, and requested load size.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadCallback.html">PageKeyedDataSource.LoadCallback</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value> callback</code></td> |
| <td> |
| <p>Callback that receives loaded data.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="api-item"><a name="loadInitial(androidx.paging.PageKeyedDataSource.LoadInitialParams, androidx.paging.PageKeyedDataSource.LoadInitialCallback)"></a><a name="loadInitial-androidx.paging.PageKeyedDataSource.LoadInitialParams-androidx.paging.PageKeyedDataSource.LoadInitialCallback-"></a><a name="loadinitial"></a> |
| <h3 class="api-name" id="loadInitial(androidx.paging.PageKeyedDataSource.LoadInitialParams,androidx.paging.PageKeyedDataSource.LoadInitialCallback)">loadInitial</h3> |
| <pre class="api-signature no-pretty-print">public abstract void <a href="/reference/androidx/paging/PageKeyedDataSource.html#loadInitial(androidx.paging.PageKeyedDataSource.LoadInitialParams,androidx.paging.PageKeyedDataSource.LoadInitialCallback)">loadInitial</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadInitialParams.html">PageKeyedDataSource.LoadInitialParams</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key> params,<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadInitialCallback.html">PageKeyedDataSource.LoadInitialCallback</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value> callback<br>)</pre> |
| <p>Load initial data.</p> |
| <p>This method is called first to initialize a PagedList with data. If it's possible to count the items that can be loaded by the DataSource, it's recommended to pass the loaded data to the callback via the three-parameter <code><a href="/reference/androidx/paging/PageKeyedDataSource.LoadInitialCallback.html#onResult(kotlin.collections.List,kotlin.Int,kotlin.Int,kotlin.Any,kotlin.Any)">LoadInitialCallback.onResult</a></code>. This enables PagedLists presenting data from this source to display placeholders to represent unloaded items.</p> |
| <p><code><a href="/reference/androidx/paging/PageKeyedDataSource.LoadInitialParams.html#requestedLoadSize()">LoadInitialParams.requestedLoadSize</a></code> is a hint, not a requirement, so it may be may be altered or ignored.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadInitialParams.html">PageKeyedDataSource.LoadInitialParams</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key> params</code></td> |
| <td> |
| <p>Parameters for initial load, including requested load size.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.LoadInitialCallback.html">PageKeyedDataSource.LoadInitialCallback</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value> callback</code></td> |
| <td> |
| <p>Callback that receives initial load data.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="api-item"><a name="map-androidx.arch.core.util.Function-"></a><a name="map"></a> |
| <h3 class="api-name" id="map(androidx.arch.core.util.Function)">map</h3> |
| <pre class="api-signature no-pretty-print">public final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.html">PageKeyedDataSource</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue> <ToValue extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/paging/PageKeyedDataSource.html#map(androidx.arch.core.util.Function)">map</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/arch/core/util/Function.html">Function</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue> function<br>)</pre> |
| <p>Applies the given function to each value emitted by the DataSource.</p> |
| <p>Same as <code><a href="/reference/androidx/paging/PageKeyedDataSource.html#mapByPage(androidx.arch.core.util.Function)">mapByPage</a></code>, but operates on individual items.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code><ToValue extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>></code></td> |
| <td> |
| <p>Type of items produced by the new DataSource, from the passed function.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/arch/core/util/Function.html">Function</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue> function</code></td> |
| <td> |
| <p>Function that runs on each loaded item, returning items of a potentially new type.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Returns</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.html">PageKeyedDataSource</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue></code></td> |
| <td> |
| <p>A new DataSource, which transforms items using the given function.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">See also</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code><a href="/reference/androidx/paging/PageKeyedDataSource.html#mapByPage(androidx.arch.core.util.Function)">mapByPage</a></code></td> |
| <td></td> |
| </tr> |
| <tr> |
| <td width="40%"><code><a href="/reference/androidx/paging/DataSource.Factory.html#map(androidx.arch.core.util.Function)">map</a></code></td> |
| <td></td> |
| </tr> |
| <tr> |
| <td width="40%"><code><a href="/reference/androidx/paging/DataSource.Factory.html#mapByPage(androidx.arch.core.util.Function)">mapByPage</a></code></td> |
| <td></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="api-item"><a name="map-kotlin.Function1-"></a><a name="map"></a> |
| <h3 class="api-name" id="map(kotlin.Function1)">map</h3> |
| <pre class="api-signature no-pretty-print">public final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.html">PageKeyedDataSource</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue> <ToValue extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/paging/PageKeyedDataSource.html#map(kotlin.Function1)">map</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1<@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue> function<br>)</pre> |
| <p>Applies the given function to each value emitted by the DataSource.</p> |
| <p>An overload of <code><a href="/reference/androidx/paging/PageKeyedDataSource.html#map(androidx.arch.core.util.Function)">map</a></code> that accepts a kotlin function type.</p> |
| <p>Same as <code><a href="/reference/androidx/paging/PageKeyedDataSource.html#mapByPage(androidx.arch.core.util.Function)">mapByPage</a></code>, but operates on individual items.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code><ToValue extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>></code></td> |
| <td> |
| <p>Type of items produced by the new DataSource, from the passed function.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1<@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue> function</code></td> |
| <td> |
| <p>Function that runs on each loaded item, returning items of a potentially new type.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Returns</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.html">PageKeyedDataSource</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue></code></td> |
| <td> |
| <p>A new DataSource, which transforms items using the given function.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">See also</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code><a href="/reference/androidx/paging/PageKeyedDataSource.html#mapByPage(androidx.arch.core.util.Function)">mapByPage</a></code></td> |
| <td></td> |
| </tr> |
| <tr> |
| <td width="40%"><code><a href="/reference/androidx/paging/DataSource.Factory.html#map(androidx.arch.core.util.Function)">map</a></code></td> |
| <td></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="api-item"><a name="mapByPage-androidx.arch.core.util.Function-"></a><a name="mapbypage"></a> |
| <h3 class="api-name" id="mapByPage(androidx.arch.core.util.Function)">mapByPage</h3> |
| <pre class="api-signature no-pretty-print">public final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.html">PageKeyedDataSource</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue> <ToValue extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/paging/PageKeyedDataSource.html#mapByPage(androidx.arch.core.util.Function)">mapByPage</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/arch/core/util/Function.html">Function</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value>, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue>> function<br>)</pre> |
| <p>Applies the given function to each value emitted by the DataSource.</p> |
| <p>Same as <code><a href="/reference/androidx/paging/PageKeyedDataSource.html#map(androidx.arch.core.util.Function)">map</a></code>, but allows for batch conversions.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code><ToValue extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>></code></td> |
| <td> |
| <p>Type of items produced by the new DataSource, from the passed function.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/arch/core/util/Function.html">Function</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value>, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue>> function</code></td> |
| <td> |
| <p>Function that runs on each loaded page, returning items of a potentially new type.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Returns</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.html">PageKeyedDataSource</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue></code></td> |
| <td> |
| <p>A new DataSource, which transforms items using the given function.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">See also</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code><a href="/reference/androidx/paging/PageKeyedDataSource.html#map(androidx.arch.core.util.Function)">map</a></code></td> |
| <td></td> |
| </tr> |
| <tr> |
| <td width="40%"><code><a href="/reference/androidx/paging/DataSource.Factory.html#map(androidx.arch.core.util.Function)">map</a></code></td> |
| <td></td> |
| </tr> |
| <tr> |
| <td width="40%"><code><a href="/reference/androidx/paging/DataSource.Factory.html#mapByPage(androidx.arch.core.util.Function)">mapByPage</a></code></td> |
| <td></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| <div class="api-item"><a name="mapByPage-kotlin.Function1-"></a><a name="mapbypage"></a> |
| <h3 class="api-name" id="mapByPage(kotlin.Function1)">mapByPage</h3> |
| <pre class="api-signature no-pretty-print">public final @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.html">PageKeyedDataSource</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue> <ToValue extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>> <a href="/reference/androidx/paging/PageKeyedDataSource.html#mapByPage(kotlin.Function1)">mapByPage</a>(<br> @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1<@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value>, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue>> function<br>)</pre> |
| <p>Applies the given function to each value emitted by the DataSource.</p> |
| <p>An overload of <code><a href="/reference/androidx/paging/PageKeyedDataSource.html#mapByPage(androidx.arch.core.util.Function)">mapByPage</a></code> that accepts a kotlin function type.</p> |
| <p>Same as <code><a href="/reference/androidx/paging/PageKeyedDataSource.html#map(androidx.arch.core.util.Function)">map</a></code>, but allows for batch conversions.</p> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Parameters</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code><ToValue extends <a href="https://developer.android.com/reference/java/lang/Object.html">Object</a>></code></td> |
| <td> |
| <p>Type of items produced by the new DataSource, from the passed function.</p> |
| </td> |
| </tr> |
| <tr> |
| <td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Function1<@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Value>, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="https://developer.android.com/reference/java/util/List.html">List</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue>> function</code></td> |
| <td> |
| <p>Function that runs on each loaded page, returning items of a potentially new type.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">Returns</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code>@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> <a href="/reference/androidx/paging/PageKeyedDataSource.html">PageKeyedDataSource</a><@<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> Key, @<a href="/reference/androidx/annotation/NonNull.html">NonNull</a> ToValue></code></td> |
| <td> |
| <p>A new <code><a href="/reference/androidx/paging/DataSource.html">DataSource</a></code>, which transforms items using the given function.</p> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="devsite-table-wrapper"> |
| <table class="responsive"> |
| <colgroup> |
| <col width="40%"> |
| <col> |
| </colgroup> |
| <thead> |
| <tr> |
| <th colspan="100%">See also</th> |
| </tr> |
| </thead> |
| <tbody class="list"> |
| <tr> |
| <td width="40%"><code><a href="/reference/androidx/paging/PageKeyedDataSource.html#map(androidx.arch.core.util.Function)">map</a></code></td> |
| <td></td> |
| </tr> |
| <tr> |
| <td width="40%"><code><a href="/reference/androidx/paging/DataSource.Factory.html#map(androidx.arch.core.util.Function)">map</a></code></td> |
| <td></td> |
| </tr> |
| <tr> |
| <td width="40%"><code><a href="/reference/androidx/paging/DataSource.Factory.html#mapByPage(androidx.arch.core.util.Function)">mapByPage</a></code></td> |
| <td></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| </div> |
| </div> |
| </body> |
| </html> |