{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

InteractionResponse.Builder

class InteractionResponse.Builder


Builder for InteractionResponse

Summary

Public constructors

Public functions

InteractionResponse!

Builds an InteractionResponse object.

InteractionResponse.Builder!

Set the RemoteError for this InteractionResponse

InteractionResponse.Builder!
setResultProto(protoByteArray: ByteArray!)

Set the result proto as a byte array.

InteractionResponse.Builder!

Public constructors

Builder

Builder()

Public functions

build

fun build(): InteractionResponse!

Builds an InteractionResponse object.

Returns
InteractionResponse!

an InteractionResponse object.

Throws
androidx.test.espresso.remote.RemoteProtocolException: androidx.test.espresso.remote.RemoteProtocolException

when conflicting properties are set. You can either set an Status with an optional RemoteError error in case that the status is 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.

androidx.test.espresso.remote.RemoteProtocolException: androidx.test.espresso.remote.RemoteProtocolException

when the provided proto byte array cannot be parsed into a protocol buffer of type InteractionResultProto

setRemoteError

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

Set the RemoteError for this InteractionResponse

Parameters
remoteError: InteractionResponse.RemoteError!

the remote error to set

Returns
InteractionResponse.Builder!

fluent interface Builder

setResultProto

fun setResultProto(protoByteArray: ByteArray!): 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 RemoteProtocolException when the build method is called!

Parameters
protoByteArray: ByteArray!

the proto byte array to set

Returns
InteractionResponse.Builder!

fluent interface Builder

setStatus

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