public static class

InteractionResponse.Builder

extends Object
java.lang.Object
   ↳ androidx.test.espresso.remote.InteractionResponse.Builder

Class Overview

Builder for InteractionResponse

Summary

Public Constructors
InteractionResponse.Builder()
Public Methods
InteractionResponse build()
Builds an InteractionResponse object.
InteractionResponse.Builder setRemoteError(InteractionResponse.RemoteError remoteError)
InteractionResponse.Builder setResultProto(byte[] protoByteArray)
Set the result proto as a byte array.
InteractionResponse.Builder setStatus(InteractionResponse.Status status)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public InteractionResponse.Builder ()

Public Methods

public InteractionResponse build ()

Builds an InteractionResponse object.

Returns
InteractionResponse an InteractionResponse object.
Throws
RemoteProtocolException when conflicting properties are set. You can either set an InteractionResponse.Status with an optional InteractionResponse.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.
RemoteProtocolException when the provided proto byte array cannot be parsed into a protocol buffer of type ERROR(/InteractionResultProto)

public InteractionResponse.Builder setRemoteError (InteractionResponse.RemoteError remoteError)

Set the InteractionResponse.RemoteError for this InteractionResponse

Parameters
remoteError InteractionResponse.RemoteError: the remote error to set
Returns
InteractionResponse.Builder fluent interface InteractionResponse.Builder

public InteractionResponse.Builder setResultProto (byte[] protoByteArray)

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

Parameters
protoByteArray byte: the proto byte array to set
Returns
InteractionResponse.Builder fluent interface InteractionResponse.Builder

public InteractionResponse.Builder setStatus (InteractionResponse.Status status)

Parameters
status InteractionResponse.Status
Returns
InteractionResponse.Builder