Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# Builder

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/android/content/pm/CapabilityParams.Builder "View this page in Java")

```
class Builder
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [android.content.pm.CapabilityParams.Builder](https://developer.android.com/reference/kotlin/android/content/pm/CapabilityParams.Builder#) |

Builder class for `https://developer.android.com/reference/kotlin/android/content/pm/CapabilityParams`.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/content/pm/CapabilityParams.Builder#Builder(kotlin.String,%20kotlin.String)(key: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html, value: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Constructor. |

| Public methods ||
|---|---|
| [CapabilityParams.Builder](https://developer.android.com/reference/kotlin/android/content/pm/CapabilityParams.Builder#) | `https://developer.android.com/reference/kotlin/android/content/pm/CapabilityParams.Builder#addAlias(kotlin.String)(alias: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` Add an alias in the `https://developer.android.com/reference/kotlin/android/content/pm/CapabilityParams`. |
| [CapabilityParams](https://developer.android.com/reference/kotlin/android/content/pm/CapabilityParams) | `https://developer.android.com/reference/kotlin/android/content/pm/CapabilityParams.Builder#build()()` Creates an instance of `https://developer.android.com/reference/kotlin/android/content/pm/CapabilityParams` |

## Public constructors

### Builder

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
Builder(
    key: String, 
    value: String)
```

Constructor.

| Parameters ||
|---|---|
| `key` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): key of the capability parameter. Note the character "/" is not permitted. This value cannot be `null`. |
| `value` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The primary name of value in the `https://developer.android.com/reference/kotlin/android/content/pm/CapabilityParams`, cannot be empty. This value cannot be `null`. |

## Public methods

### addAlias

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun addAlias(alias: String): CapabilityParams.Builder
```

Add an alias in the `https://developer.android.com/reference/kotlin/android/content/pm/CapabilityParams`.

| Parameters ||
|---|---|
| `alias` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): This value cannot be `null`. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/content/pm/CapabilityParams.Builder#` | This value cannot be `null`. |

### build

Added in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

```
fun build(): CapabilityParams
```

Creates an instance of `https://developer.android.com/reference/kotlin/android/content/pm/CapabilityParams`

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/content/pm/CapabilityParams` | This value cannot be `null`. |

| Exceptions ||
|---|---|
| `java.lang.IllegalArgumentException` | If the specified value is empty. |