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

*** ** * ** ***


```
class SchemaChangeInfo
```

<br />

*** ** * ** ***

Contains information about a schema change detected by an `https://developer.android.com/reference/kotlin/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/kotlin/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/kotlin/androidx/appsearch/observer/DocumentChangeInfo`. The only notification will be of the schema type change via `https://developer.android.com/reference/kotlin/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/kotlin/androidx/appsearch/observer/SchemaChangeInfo#SchemaChangeInfo(java.lang.String,java.lang.String,java.util.Set<java.lang.String>)( packageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, databaseName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html, changedSchemaNames: (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/SchemaChangeInfo`. |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/SchemaChangeInfo#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/SchemaChangeInfo#getChangedSchemaNames()()` Returns the names of schema types affected by this change notification. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/SchemaChangeInfo#getDatabaseName()()` Returns the database in which the schema that was changed resides. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/SchemaChangeInfo#getPackageName()()` Returns the package name of the app which owns the schema that changed. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/SchemaChangeInfo#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/appsearch/observer/SchemaChangeInfo#toString()()` |

## Public constructors

### SchemaChangeInfo

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

```
SchemaChangeInfo(
    packageName: String,
    databaseName: String,
    changedSchemaNames: (Mutable)Set<String!>
)
```

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

| Parameters |
|---|---|
| `packageName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The package name of the app which owns the schema that changed. |
| `databaseName: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | The database in which the schema that changed resides. |
| `changedSchemaNames: (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!>` | Names of schemas that have changed as part of this notification. |

## Public functions

### equals

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

### getChangedSchemaNames

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

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

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)

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

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)

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

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

### hashCode

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

### toString

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