InteractionResponse.Builder


public class InteractionResponse.Builder


Builder for InteractionResponse

Summary

Public constructors

Public constructors

Builder

public Builder()

Public methods

build

public InteractionResponse build()

Builds an InteractionResponse object.

Throws
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

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