# SchemaChangeInfo

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

*** ** * ** ***


```
public final class SchemaChangeInfo
```

<br />

*** ** * ** ***

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

This object will be sent when a schema type having a name matching an observer's schema filters (as determined by `https://developer.android.com/reference/androidx/appsearch/observer/ObserverSpec#getFilterSchemas()`) has been added, updated, or removed.

Note that schema changes may cause documents to be migrated or removed. When this happens, individual document updates will NOT be dispatched via `https://developer.android.com/reference/androidx/appsearch/observer/DocumentChangeInfo`. The only notification will be of the schema type change via `https://developer.android.com/reference/androidx/appsearch/observer/SchemaChangeInfo`. Depending on your use case, you may need to re-query the whole schema type when this happens.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/observer/SchemaChangeInfo#SchemaChangeInfo(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 databaseName, @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> changedSchemaNames )` Constructs a new `https://developer.android.com/reference/androidx/appsearch/observer/SchemaChangeInfo`. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/appsearch/observer/SchemaChangeInfo#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/SchemaChangeInfo#getChangedSchemaNames()()` Returns the names of schema types affected by this change 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/SchemaChangeInfo#getDatabaseName()()` Returns the database in which the schema that was changed resides. |
| `@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/SchemaChangeInfo#getPackageName()()` Returns the package name of the app which owns the schema that changed. |
| `int` | `https://developer.android.com/reference/androidx/appsearch/observer/SchemaChangeInfo#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/SchemaChangeInfo#toString()()` |

## Public constructors

### SchemaChangeInfo

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

```
public SchemaChangeInfo(
    @NonNull String packageName,
    @NonNull String databaseName,
    @NonNull Set<String> changedSchemaNames
)
```

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

| 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 schema that changed. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html databaseName` | The database in which the schema that changed resides. |
| `@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> changedSchemaNames` | Names of schemas that have changed as part of this notification. |

## Public methods

### equals

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

### getChangedSchemaNames

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

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

Returns the names of schema types affected by this change 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 schema that was changed resides.

### 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 schema that changed.

### hashCode

```
public int hashCode()
```

### toString

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