# DocumentChangeInfo

Artifact: [androidx.appsearch:appsearch](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/observer/DocumentChangeInfo.java+class:androidx.appsearch.observer.DocumentChangeInfo) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
class DocumentChangeInfo
```

<br />

*** ** * ** ***

Contains information about an individual change detected by an `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/ObserverCallback`.

This class reports information about document changes, that is, when documents were added, updated or removed.

Changes are grouped by package, database, schema type and namespace. Each unique combination of these items will generate a unique `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/DocumentChangeInfo`.

Notifications are only sent for documents whose schema type matches an observer's schema filters (as determined by `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/ObserverSpec#getFilterSchemas()`).

Note that document changes that happen during schema migration from calling `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchSession#setSchemaAsync(androidx.appsearch.app.SetSchemaRequest)` are not reported via this class. Such changes are reported through `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/SchemaChangeInfo`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/DocumentChangeInfo#DocumentChangeInfo(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.util.Set<java.lang.String>)( packageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, database: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, namespace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, schemaName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, changedDocumentIds: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!> )` Constructs a new `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/DocumentChangeInfo`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/DocumentChangeInfo#equals(java.lang.Object)(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` |
| `(https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` | `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/DocumentChangeInfo#getChangedDocumentIds()()` Returns the set of document IDs that have been changed as part of this notification. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/DocumentChangeInfo#getDatabaseName()()` Returns the database in which the documents that was changed reside. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/DocumentChangeInfo#getNamespace()()` Returns the namespace of the documents that changed. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/DocumentChangeInfo#getPackageName()()` Returns the package name of the app which owns the documents that changed. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/DocumentChangeInfo#getSchemaName()()` Returns the name of the schema type that contains the changed documents. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/DocumentChangeInfo#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/DocumentChangeInfo#toString()()` |

## Public constructors

### DocumentChangeInfo

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
DocumentChangeInfo(
    packageName: String,
    database: String,
    namespace: String,
    schemaName: String,
    changedDocumentIds: (Mutable)Set<String!>
)
```

Constructs a new `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/DocumentChangeInfo`.

| Parameters |
|---|---|
| `packageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The package name of the app which owns the documents that changed. |
| `database: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The database in which the documents that changed reside. |
| `namespace: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The namespace in which the documents that changed reside. |
| `schemaName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The name of the schema type that contains the changed documents. |
| `changedDocumentIds: (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-set/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-set/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>` | The set of document IDs that have been changed as part of this notification. |

## Public functions

### equals

```
fun equals(o: Any?): Boolean
```

### getChangedDocumentIds

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getChangedDocumentIds(): (Mutable)Set<String!>
```

Returns the set of document IDs that have been changed as part of this notification.

This will never be empty.

### getDatabaseName

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getDatabaseName(): String
```

Returns the database in which the documents that was changed reside.

### getNamespace

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getNamespace(): String
```

Returns the namespace of the documents that changed.

### getPackageName

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getPackageName(): String
```

Returns the package name of the app which owns the documents that changed.

### getSchemaName

Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

```
fun getSchemaName(): String
```

Returns the name of the schema type that contains the changed documents.

### hashCode

```
fun hashCode(): Int
```

### toString

```
fun toString(): String
```