# KeyedAppState.KeyedAppStateBuilder

# KeyedAppState.KeyedAppStateBuilder

Artifact: [androidx.enterprise:enterprise-feedback](https://developer.android.com/jetpack/androidx/releases/enterprise)  
[View Source](https://cs.android.com/search?q=file:androidx/enterprise/feedback/KeyedAppState.java+class:androidx.enterprise.feedback.KeyedAppState.KeyedAppStateBuilder)  
Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/enterprise#1.0.0)

*** ** * ** ***

Kotlin \|[Java](https://developer.android.com/reference/androidx/enterprise/feedback/KeyedAppState.KeyedAppStateBuilder "View this page in Java")


```
@AutoValue.Builder
abstract class KeyedAppState.KeyedAppStateBuilder
```

<br />

*** ** * ** ***

The builder for [KeyedAppState](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState).

## Summary

|                                                                      ### Public functions                                                                       |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [KeyedAppState](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState)                                                      | [build](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState.KeyedAppStateBuilder#build())`()` Instantiate the [KeyedAppState](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState).                                                                                                                      |
| `abstract `[KeyedAppState.KeyedAppStateBuilder](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState.KeyedAppStateBuilder) | [setData](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState.KeyedAppStateBuilder#setData(java.lang.String))`(data: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?)` Set [getData](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState#getData()).                |
| `abstract `[KeyedAppState.KeyedAppStateBuilder](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState.KeyedAppStateBuilder) | [setKey](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState.KeyedAppStateBuilder#setKey(java.lang.String))`(key: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`)` Set [getKey](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState#getKey()).                      |
| `abstract `[KeyedAppState.KeyedAppStateBuilder](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState.KeyedAppStateBuilder) | [setMessage](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState.KeyedAppStateBuilder#setMessage(java.lang.String))`(message: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`?)` Set [getMessage](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState#getMessage()). |
| `abstract `[KeyedAppState.KeyedAppStateBuilder](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState.KeyedAppStateBuilder) | [setSeverity](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState.KeyedAppStateBuilder#setSeverity(int))`(severity: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Set [getSeverity](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState#getSeverity()).                |

## Public functions

### build

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

```
fun build(): KeyedAppState
```

Instantiate the [KeyedAppState](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState).

Severity will default to [SEVERITY_INFO](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState#SEVERITY_INFO()) if not set.

Assumes the key is set, key length is at most 100 characters, message length is as most 1000 characters, data length is at most 1000 characters, and severity is set to either [SEVERITY_INFO](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState#SEVERITY_INFO()) or [SEVERITY_ERROR](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState#SEVERITY_ERROR()).  

### setData

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

```
abstract fun setData(data: String?): KeyedAppState.KeyedAppStateBuilder
```

Set [getData](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState#getData()).  

### setKey

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

```
abstract fun setKey(key: String): KeyedAppState.KeyedAppStateBuilder
```

Set [getKey](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState#getKey()).  

### setMessage

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

```
abstract fun setMessage(message: String?): KeyedAppState.KeyedAppStateBuilder
```

Set [getMessage](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState#getMessage()).  

### setSeverity

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

```
abstract fun setSeverity(severity: Int): KeyedAppState.KeyedAppStateBuilder
```

Set [getSeverity](https://developer.android.com/reference/kotlin/androidx/enterprise/feedback/KeyedAppState#getSeverity()).