# InteractionResponse.Builder

Artifact: [androidx.test.espresso:espresso-remote](https://developer.android.com/jetpack/androidx/releases/test-espresso) [View Source](https://cs.android.com/search?q=file:androidx/test/espresso/remote/InteractionResponse.java+class:androidx.test.espresso.remote.InteractionResponse.Builder)

*** ** * ** ***


```
class InteractionResponse.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse`

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Builder#Builder()()` |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse!` | `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Builder#build()()` Builds an `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse` object. |
| `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Builder!` | `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Builder#setRemoteError(androidx.test.espresso.remote.InteractionResponse.RemoteError)(remoteError: https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.RemoteError?)` Set the `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.RemoteError` for this `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse` |
| `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Builder!` | `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Builder#setResultProto(byte[])(protoByteArray: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>)` Set the result proto as a byte array. |
| `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Builder!` | `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Builder#setStatus(androidx.test.espresso.remote.InteractionResponse.Status)(status: https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Status)` |

## Public constructors

### Builder

```
Builder()
```

## Public functions

### build

```
fun build(): InteractionResponse!
```

Builds an `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse` object.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse!` | an `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse` object. |

| Throws |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/RemoteProtocolException` | when conflicting properties are set. You can either set an `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Status` with an optional `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.RemoteError` error in case that the status is `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Status#Error` or set the proto byte array not both. Setting both values would result in an override, therefore setting both properties will result in an exception. |
| `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/RemoteProtocolException` | when the provided proto byte array cannot be parsed into a protocol buffer of type |

### setRemoteError

```
fun setRemoteError(remoteError: InteractionResponse.RemoteError?): InteractionResponse.Builder!
```

Set the `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.RemoteError` for this `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse`

| Parameters |
|---|---|
| `remoteError: https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.RemoteError?` | the remote error to set |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Builder!` | fluent interface `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Builder` |

### setResultProto

```
fun setResultProto(protoByteArray: ByteArray<Byte>): InteractionResponse.Builder!
```

Set the result proto as a byte array. This byte array will be parsed into an . Providing an invalid byte byte array will result in a `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/RemoteProtocolException` when the `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Builder#build()` method is called!

| Parameters |
|---|---|
| `protoByteArray: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-byte/index.html>` | the proto byte array to set |

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Builder!` | fluent interface `https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/InteractionResponse.Builder` |

### setStatus

```
fun setStatus(status: InteractionResponse.Status): InteractionResponse.Builder!
```