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

InteractionResponse.Builder

public class InteractionResponse.Builder


Builder for InteractionResponse

Summary

Public constructors

Public methods

InteractionResponse

Builds an InteractionResponse object.

InteractionResponse.Builder

Set the RemoteError for this InteractionResponse

InteractionResponse.Builder
setResultProto(@NonNull byte[] protoByteArray)

Set the result proto as a byte array.

InteractionResponse.Builder

Public constructors

Builder

public final Builder()

Public methods

build

public InteractionResponse build()

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 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

public InteractionResponse.Builder setRemoteError(@Nullable InteractionResponse.RemoteError remoteError)

Set the RemoteError for this InteractionResponse

Parameters
@Nullable InteractionResponse.RemoteError remoteError

the remote error to set

Returns
InteractionResponse.Builder

fluent interface Builder

setResultProto

public InteractionResponse.Builder setResultProto(@NonNull byte[] protoByteArray)

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 when the build method is called!

Parameters
@NonNull byte[] protoByteArray

the proto byte array to set

Returns
InteractionResponse.Builder

fluent interface Builder

setStatus

public InteractionResponse.Builder setStatus(@NonNull InteractionResponse.Status status)