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

public InteractionResponse.Builder setRemoteError(InteractionResponse.RemoteError remoteError)

Set the RemoteError for this InteractionResponse

Parameters
InteractionResponse.RemoteError remoteError

the remote error to set

Returns
InteractionResponse.Builder

fluent interface Builder

setResultProto

public InteractionResponse.Builder setResultProto(byte[] protoByteArray)

Set the result proto as a byte array. This byte array will be parsed into an InteractionResultProto. Providing an invalid byte byte array will result in a RemoteProtocolException when the build method is called!

Parameters
byte[] protoByteArray

the proto byte array to set

Returns
InteractionResponse.Builder

fluent interface Builder