# PotentialAction.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/PotentialAction.java+class:androidx.appsearch.builtintypes.PotentialAction.Builder) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/appsearch#1.1.0)

*** ** * ** ***


```
public final class PotentialAction.Builder
```

<br />

*** ** * ** ***

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

## Summary

| ### Protected fields |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction.Builder#mDescription()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction.Builder#mName()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction.Builder#mUri()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction.Builder#Builder()()` Constructor for `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction.Builder`. |
| `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction.Builder#Builder(androidx.appsearch.builtintypes.PotentialAction)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction potentialAction)` Constructor with all the existing values. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction.Builder#build()()` Builds the `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction`. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction.Builder#setDescription(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html description)` Sets the description of the action, such as "Call". |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction.Builder#setName(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html name)` Sets the name of the action. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html T` | `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction.Builder#setUri(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/String.html uri)` Sets the deeplink URI of the Action. |

## Protected fields

### mDescription

```
protected @Nullable String mDescription
```

### mName

```
protected @Nullable String mName
```

### mUri

```
protected @Nullable String mUri
```

## Public constructors

### Builder

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

```
public Builder()
```

Constructor for `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction.Builder`.

As PotentialAction is used as a DocumentProperty of Thing, it does not need an id or namespace.

### Builder

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

```
public Builder(@NonNull PotentialAction potentialAction)
```

Constructor with all the existing values.

As PotentialAction is used as a DocumentProperty of Thing, it does not need an id or namespace.

## Public methods

### build

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

```
public @NonNull PotentialAction build()
```

Builds the `https://developer.android.com/reference/androidx/appsearch/builtintypes/PotentialAction`.

### setDescription

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

```
public @NonNull T setDescription(@Nullable String description)
```

Sets the description of the action, such as "Call".

### setName

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

```
public @NonNull T setName(@Nullable String name)
```

Sets the name of the action.

### setUri

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

```
public @NonNull T setUri(@Nullable String uri)
```

Sets the deeplink URI of the Action.

A deeplink URI is a URI that lets a user access a specific content or feature within an app directly. Users can create one by adding parameters to the app's base URI. To use a deeplink URI in an Android application, users can create an `https://developer.android.com/reference/android/content/Intent.html` object by calling `https://developer.android.com/reference/android/content/Intent.html#parseUri(java.lang.String, int)` with the deeplink URI. Creating a deeplink URI, and adding intent extras, can be done by building an intent and calling `https://developer.android.com/reference/android/content/Intent.html#toUri(int)`.