# 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)

*** ** * ** ***


```
public final class DocumentChangeInfo
```

<br />

*** ** * ** ***

Contains information about an individual change detected by an `https://developer.android.com/reference/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/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/androidx/appsearch/observer/ObserverSpec#getFilterSchemas()`).

Note that document changes that happen during schema migration from calling `https://developer.android.com/reference/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/androidx/appsearch/observer/SchemaChangeInfo`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/observer/DocumentChangeInfo#DocumentChangeInfo(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.util.Set<java.lang.String>)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html packageName, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html database, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html namespace, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html schemaName, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/java/lang/String.html> changedDocumentIds )` Constructs a new `https://developer.android.com/reference/androidx/appsearch/observer/DocumentChangeInfo`. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/appsearch/observer/DocumentChangeInfo#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html o)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/appsearch/observer/DocumentChangeInfo#getChangedDocumentIds()()` Returns the set of document IDs that have been changed as part of this notification. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/observer/DocumentChangeInfo#getDatabaseName()()` Returns the database in which the documents that was changed reside. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/observer/DocumentChangeInfo#getNamespace()()` Returns the namespace of the documents that changed. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/observer/DocumentChangeInfo#getPackageName()()` Returns the package name of the app which owns the documents that changed. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/observer/DocumentChangeInfo#getSchemaName()()` Returns the name of the schema type that contains the changed documents. |
| `int` | `https://developer.android.com/reference/androidx/appsearch/observer/DocumentChangeInfo#hashCode()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/observer/DocumentChangeInfo#toString()()` |

## Public constructors

### DocumentChangeInfo

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

```
public DocumentChangeInfo(
    @NonNull String packageName,
    @NonNull String database,
    @NonNull String namespace,
    @NonNull String schemaName,
    @NonNull Set<String> changedDocumentIds
)
```

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

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html packageName` | The package name of the app which owns the documents that changed. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html database` | The database in which the documents that changed reside. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html namespace` | The namespace in which the documents that changed reside. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html schemaName` | The name of the schema type that contains the changed documents. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Set.html<https://developer.android.com/reference/java/lang/String.html> changedDocumentIds` | The set of document IDs that have been changed as part of this notification. |

## Public methods

### equals

```
public boolean equals(@Nullable Object o)
```

### getChangedDocumentIds

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

```
public @NonNull Set<String> getChangedDocumentIds()
```

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)

```
public @NonNull String getDatabaseName()
```

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)

```
public @NonNull String getNamespace()
```

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)

```
public @NonNull String getPackageName()
```

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)

```
public @NonNull String getSchemaName()
```

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

### hashCode

```
public int hashCode()
```

### toString

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