# PagingSource.LoadResult.Invalid

Artifact: [androidx.paging:paging-common](https://developer.android.com/jetpack/androidx/releases/paging) [View Source](https://cs.android.com/search?q=file:androidx/paging/PagingSource.kt+class:androidx.paging.PagingSource.LoadResult.Invalid) Added in [3.1.0](https://developer.android.com/jetpack/androidx/releases/paging#3.1.0)

*** ** * ** ***


```
public final class PagingSource.LoadResult.Invalid<Key extends Object, Value extends Object> extends PagingSource.LoadResult<@NonNull Key, @NonNull Value>
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.paging.PagingSource.LoadResult](https://developer.android.com/reference/androidx/paging/PagingSource.LoadResult)\<@[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull) Key, @[NonNull](https://developer.android.com/reference/androidx/annotation/NonNull) Value\> ||
|   | ↳ | [androidx.paging.PagingSource.LoadResult.Invalid](https://developer.android.com/reference/androidx/paging/PagingSource.LoadResult.Invalid) |

*** ** * ** ***

Invalid result object for `https://developer.android.com/reference/androidx/paging/PagingSource#load(androidx.paging.PagingSource.LoadParams)`

This return type can be used to terminate future load requests on this `https://developer.android.com/reference/androidx/paging/PagingSource` when the `https://developer.android.com/reference/androidx/paging/PagingSource` is not longer valid due to changes in the underlying dataset.

For example, if the underlying database gets written into but the `https://developer.android.com/reference/androidx/paging/PagingSource` does not invalidate in time, it may return inconsistent results if its implementation depends on the immutability of the backing dataset it loads from (e.g., LIMIT OFFSET style db implementations). In this scenario, it is recommended to check for invalidation after loading and to return LoadResult.Invalid, which causes Paging to discard any pending or future load requests to this PagingSource and invalidate it.

Returning `https://developer.android.com/reference/androidx/paging/PagingSource.LoadResult.Invalid` will trigger Paging to `https://developer.android.com/reference/androidx/paging/PagingSource#invalidate()` this `https://developer.android.com/reference/androidx/paging/PagingSource` and terminate any future attempts to `https://developer.android.com/reference/androidx/paging/PagingSource#load(androidx.paging.PagingSource.LoadParams)` from this `https://developer.android.com/reference/androidx/paging/PagingSource`

## 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> https://developer.android.com/reference/androidx/paging/PagingSource.LoadResult.Invalid#Invalid()()` |

| ### Public methods |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/paging/PagingSource.LoadResult.Invalid#toString()()` |

## Public constructors

### Invalid

```
public <Key extends Object, Value extends Object> Invalid()
```

## Public methods

### toString

```
public @NonNull String toString()
```