# AppSearchDocumentClassMap

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

*** ** * ** ***


```
@AnyThread
abstract class AppSearchDocumentClassMap
```

<br />

*** ** * ** ***

A class that maintains the map from schema type names to the fully qualified names of the corresponding document classes.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchDocumentClassMap#AppSearchDocumentClassMap()()` |

| ### Public functions |
|---|---|
| `java-static (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!>` | `@https://developer.android.com/reference/kotlin/androidx/annotation/WorkerThread https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchDocumentClassMap#getGlobalMap()()` Returns the global map that includes all AppSearch document classes annotated with `https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document` that are available in the current runtime. |

| ### Protected functions |
|---|---|
| `abstract (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, (https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-list/index.html)https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-list/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!>!>` | `https://developer.android.com/reference/kotlin/androidx/appsearch/app/AppSearchDocumentClassMap#getMap()()` Returns the map from schema type names to the list of the fully qualified names of the corresponding document classes. |

## Public constructors

### AppSearchDocumentClassMap

Added in 1.1.0

```
AppSearchDocumentClassMap()
```

## Public functions

### getGlobalMap

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

```
@WorkerThread
java-static fun getGlobalMap(): (Mutable)Map<String!, (Mutable)List<String!>!>
```

Returns the global map that includes all AppSearch document classes annotated with `https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document` that are available in the current runtime. It maps from AppSearch's type name specified by `https://developer.android.com/reference/kotlin/androidx/appsearch/annotation/Document#name()` to the list of the fully qualified names of the corresponding document classes. The values are lists because it is possible that two document classes are associated with the same AppSearch type name.

Note that although this method, under normal circumstances, executes quickly, it performs a synchronous disk read operation in order to build the map, which means it can potentially introduce I/O blocking if executed on the main thread.

Since every call to this method should return the same map, the value of this map will be internally cached, so that only the first call will perform disk I/O.

## Protected functions

### getMap

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

```
protected abstract fun getMap(): (Mutable)Map<String!, (Mutable)List<String!>!>
```

Returns the map from schema type names to the list of the fully qualified names of the corresponding document classes.