# GlobalSearchApplicationInfo.Builder

Artifact: [androidx.appsearch:appsearch-builtin-types](https://developer.android.com/jetpack/androidx/releases/appsearch) [View Source](https://cs.android.com/search?q=file:androidx/appsearch/builtintypes/GlobalSearchApplicationInfo.java+class:androidx.appsearch.builtintypes.GlobalSearchApplicationInfo.Builder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***

<br />

```
public final class GlobalSearchApplicationInfo.Builder
```

<br />

*** ** * ** ***

Builder class for `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo`.

## Summary

| ### Protected fields |
|---|---|
| `final int` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo.Builder#mApplicationType()` |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo.Builder#mId()` |
| `final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo.Builder#mNamespace()` |
| `https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo.Builder#mSchemaTypes()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo.Builder#Builder(java.lang.String,java.lang.String,int)(@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 id, int applicationType)` Constructs a new `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo.Builder`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo.Builder#build()()` Constructs a new `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo.Builder#setDocumentClasses(java.util.List<java.lang.Class<?>>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> schemaClasses)` Sets the list of schemas this app is capable of producing (if `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo#getApplicationType()` is `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo#APPLICATION_TYPE_PRODUCER()`) or interested in consuming (if `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo#getApplicationType()`). |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo.Builder#setSchemaTypes(java.util.List<java.lang.String>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html> schemaTypes)` Sets the list of schema type names this app is capable of producing (if `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo#getApplicationType()` is `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo#APPLICATION_TYPE_PRODUCER()`) or interested in consuming (if `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo#getApplicationType()`). |

## Protected fields

### mApplicationType

```
protected final int mApplicationType
```

### mId

```
protected final String mId
```

### mNamespace

```
protected final String mNamespace
```

### mSchemaTypes

```
protected List<String> mSchemaTypes
```

## Public constructors

### Builder

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

```
public Builder(@NonNull String namespace, @NonNull String id, int applicationType)
```

Constructs a new `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo.Builder`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html namespace` | an arbitrary string corresponding to a logical grouping for this `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo`. All AppSearch documents must have a namespace. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html id` | the identifier for this GlobalSearchApplicationInfo. AppSearch IDs are unique within their combination of package, database and namespace. |
| `int applicationType` | whether the application is capable of producing, or interested in consuming, the schema types configured by `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo.BuilderImpl#setSchemaTypes(java.util.List<java.lang.String>)` or `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo.BuilderImpl#setDocumentClasses(java.util.List<java.lang.Class<?>>)`. |

## Public methods

### build

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

```
public @NonNull GlobalSearchApplicationInfo build()
```

Constructs a new `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo`.

### setDocumentClasses

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

```
public @NonNull T setDocumentClasses(@NonNull List<@NonNull Class<@NonNull ?>> schemaClasses)
```

Sets the list of schemas this app is capable of producing (if `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo#getApplicationType()` is `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo#APPLICATION_TYPE_PRODUCER()`) or interested in consuming (if `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo#getApplicationType()`).

This method is equivalent to `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo.BuilderImpl#setSchemaTypes(java.util.List<java.lang.String>)` but accepts document classes instead of schema name strings.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?>> schemaClasses` | A list of classes annotated with the @`https://developer.android.com/reference/androidx/appsearch/annotation/Document` annotation which correspond to the schemas this app produces or consumes. |

| Throws |
|---|---|
| `https://developer.android.com/reference/androidx/appsearch/exceptions/AppSearchException` | if the schemaClasses are not @`https://developer.android.com/reference/androidx/appsearch/annotation/Document`-annotated classes or extraction of the schema name fails. |

### setSchemaTypes

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

```
public @NonNull T setSchemaTypes(@NonNull List<@NonNull String> schemaTypes)
```

Sets the list of schema type names this app is capable of producing (if `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo#getApplicationType()` is `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo#APPLICATION_TYPE_PRODUCER()`) or interested in consuming (if `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo#getApplicationType()`).

This method is equivalent to `https://developer.android.com/reference/androidx/appsearch/builtintypes/GlobalSearchApplicationInfo.BuilderImpl#setDocumentClasses(java.util.List<java.lang.Class<?>>)` but accepts schema name strings instead of extracting schema information from document classes.