# RemoteDescriptor.Builder

Summary:[Ctors](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder#pubctors)\|[Methods](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder#)  

# RemoteDescriptor.Builder

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public
static
final

class
RemoteDescriptor.Builder
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object.html)`


``


`

|---|---------------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||
| ↳ | android.support.test.espresso.remote.RemoteDescriptor.Builder |

<br />

*** ** * ** ***

Builder for[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor)

## Summary

|                                                                         ### Public constructors                                                                         ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder#RemoteDescriptor.Builder())`() ` |

|                                                                                                                                                                                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                                                                                                                                                                                              ||
|--------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` `[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor)                 | ` `[build](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder#build())`() ` Builds a[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor)from the builder properties set.                                                                                                                                                                                                                                                                                                                                               |
| ` `[RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder) | ` `[setInstanceFieldDescriptors](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder#setInstanceFieldDescriptors(android.support.test.espresso.remote.FieldDescriptor...))`(`[FieldDescriptor...](https://developer.android.com/reference/android/support/test/espresso/remote/FieldDescriptor)` fieldDescriptors) ` Sets the[FieldDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/FieldDescriptor)s associated with this[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor). |
| ` `[RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder) | ` `[setInstanceType](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder#setInstanceType(java.lang.Class<?>))`(`[Class](https://developer.android.com/reference/java/lang/Class.html)`<?> instanceType) ` Sets the instance type for associated with this[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor).                                                                                                                                                                                                          |
| ` `[RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder) | ` `[setProtoBuilderType](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder#setProtoBuilderType(java.lang.Class<?>))`(`[Class](https://developer.android.com/reference/java/lang/Class.html)`<?> protoBuilderType) ` Sets the type of the proto message builder associated with this[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor).                                                                                                                                                                              |
| ` `[RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder) | ` `[setProtoParser](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder#setProtoParser(com.google.protobuf.Parser<?>))`(Parser<?> protoParser) ` Sets the type of the proto message parser associated with this[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor).                                                                                                                                                                                                                                                    |
| ` `[RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder) | ` `[setProtoType](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder#setProtoType(java.lang.Class<?>))`(`[Class](https://developer.android.com/reference/java/lang/Class.html)`<?> protoType) ` Sets the type of the proto message associated with this[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor).                                                                                                                                                                                                           |
| ` `[RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder) | ` `[setRemoteConstrTypes](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder#setRemoteConstrTypes(java.lang.Class<?>...))`(`[Class...](https://developer.android.com/reference/java/lang/Class.html)`<?> remoteConstrTypes) ` Sets the remote constructor types of the[EspressoRemoteMessage](https://developer.android.com/reference/android/support/test/espresso/remote/EspressoRemoteMessage)associated with this[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor).                                             |
| ` `[RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder) | ` `[setRemoteType](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder#setRemoteType(java.lang.Class<?>))`(`[Class](https://developer.android.com/reference/java/lang/Class.html)`<?> remoteType) ` Sets the type of the[EspressoRemoteMessage](https://developer.android.com/reference/android/support/test/espresso/remote/EspressoRemoteMessage)associated with this[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor).                                                                                            |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder#)From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                                | | ` boolean`                                                                          | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                             | ` finalize() `                                                                             | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                             | | ` int`                                                                              | ` hashCode() `                                                                             | | ` final void`                                                                       | ` notify() `                                                                               | | ` final void`                                                                       | ` notifyAll() `                                                                            | | ` `[String](https://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                             | | ` final void`                                                                       | ` wait(long arg0, int arg1) `                                                              | | ` final void`                                                                       | ` wait(long arg0) `                                                                        | | ` final void`                                                                       | ` wait() `                                                                                 | ||

## Public constructors

### RemoteDescriptor.Builder

```
RemoteDescriptor.Builder ()
```

<br />

<br />

## Public methods

### build

```
RemoteDescriptor build ()
```

Builds a[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor)from the builder properties set.

<br />

|                                                          Returns                                                          ||
|-------------------------------------------------------------------------------------------------------------------|--------|
| [RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor) | <br /> |

### setInstanceFieldDescriptors

```
RemoteDescriptor.Builder setInstanceFieldDescriptors (FieldDescriptor... fieldDescriptors)
```

Sets the[FieldDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/FieldDescriptor)s associated with this[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor).

The field descriptor order, must match the`instanceType`s declared constructor parameter order.

Note: Any field descriptors passed to this method will be overwritten by field descriptors annotated with[RemoteMsgField](https://developer.android.com/reference/android/support/test/espresso/remote/annotation/RemoteMsgField).

<br />

|                                                                              Returns                                                                               ||
|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------|
| [RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder) | fluent builder interface <br /> |

### setInstanceType

```
RemoteDescriptor.Builder setInstanceType (Class<?> instanceType)
```

Sets the instance type for associated with this[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor).

The instance type represents the class that will be converted to and from a proto.

<br />

|                                                                              Returns                                                                               ||
|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------|
| [RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder) | fluent builder interface <br /> |

### setProtoBuilderType

```
RemoteDescriptor.Builder setProtoBuilderType (Class<?> protoBuilderType)
```

Sets the type of the proto message builder associated with this[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor).

By default the proto builder will be created by this class. Only call this method if a custom builder is required.

<br />

|                             Parameters                              ||
|--------------------|-------------------------------------------------|
| `protoBuilderType` | `Class`: the proto message builder class <br /> |

|                                                                              Returns                                                                               ||
|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------|
| [RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder) | fluent builder interface <br /> |

### setProtoParser

```
RemoteDescriptor.Builder setProtoParser (Parser<?> protoParser)
```

Sets the type of the proto message parser associated with this[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor).

By default the proto parser is inferred from the`protoType`. Only call this method if a custom parser is required.

<br />

|                    Parameters                    ||
|---------------|-----------------------------------|
| `protoParser` | `Parser`: the proto parser <br /> |

|                                                                              Returns                                                                               ||
|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------|
| [RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder) | fluent builder interface <br /> |

### setProtoType

```
RemoteDescriptor.Builder setProtoType (Class<?> protoType)
```

Sets the type of the proto message associated with this[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor).

<br />

|                      Parameters                      ||
|-------------|-----------------------------------------|
| `protoType` | `Class`: the proto message class <br /> |

|                                                                              Returns                                                                               ||
|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------|
| [RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder) | fluent builder interface <br /> |

### setRemoteConstrTypes

```
RemoteDescriptor.Builder setRemoteConstrTypes (Class...<?> remoteConstrTypes)
```

Sets the remote constructor types of the[EspressoRemoteMessage](https://developer.android.com/reference/android/support/test/espresso/remote/EspressoRemoteMessage)associated with this[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor).

The types passed to this method will be used to reflectively infer the remote message constructor.

By default the`instanceType`is used as remote message constructor. Only set custom remote constructor types, when the remote message constructor takes a superclass or interface, implemented by the instance type. Don't call this method when using[GenericRemoteMessage](https://developer.android.com/reference/android/support/test/espresso/remote/GenericRemoteMessage).

<br />

|                                                                              Returns                                                                               ||
|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------|
| [RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder) | fluent builder interface <br /> |

### setRemoteType

```
RemoteDescriptor.Builder setRemoteType (Class<?> remoteType)
```

Sets the type of the[EspressoRemoteMessage](https://developer.android.com/reference/android/support/test/espresso/remote/EspressoRemoteMessage)associated with this[RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor).

<br />

|                       Parameters                       ||
|--------------|------------------------------------------|
| `remoteType` | `Class`: the remote message class <br /> |

|                                                                              Returns                                                                               ||
|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------|
| [RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder) | fluent builder interface <br /> |

-

  ## Interfaces

  - [Bindable](https://developer.android.com/reference/android/support/test/espresso/remote/Bindable)
  - [Converter](https://developer.android.com/reference/android/support/test/espresso/remote/Converter)
  - [EspressoRemoteMessage](https://developer.android.com/reference/android/support/test/espresso/remote/EspressoRemoteMessage)
  - [EspressoRemoteMessage.From](https://developer.android.com/reference/android/support/test/espresso/remote/EspressoRemoteMessage.From)
  - [EspressoRemoteMessage.To](https://developer.android.com/reference/android/support/test/espresso/remote/EspressoRemoteMessage.To)
  - [RemoteInteraction](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteInteraction)
-

  ## Classes

  - [ConstructorInvocation](https://developer.android.com/reference/android/support/test/espresso/remote/ConstructorInvocation)
  - [EspressoRemote](https://developer.android.com/reference/android/support/test/espresso/remote/EspressoRemote)
  - [FieldDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/FieldDescriptor)
  - [GenericRemoteMessage](https://developer.android.com/reference/android/support/test/espresso/remote/GenericRemoteMessage)
  - [InteractionRequest](https://developer.android.com/reference/android/support/test/espresso/remote/InteractionRequest)
  - [InteractionRequest.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/InteractionRequest.Builder)
  - [InteractionResponse](https://developer.android.com/reference/android/support/test/espresso/remote/InteractionResponse)
  - [InteractionResponse.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/InteractionResponse.Builder)
  - [InteractionResponse.RemoteError](https://developer.android.com/reference/android/support/test/espresso/remote/InteractionResponse.RemoteError)
  - [NoopRemoteInteraction](https://developer.android.com/reference/android/support/test/espresso/remote/NoopRemoteInteraction)
  - [ProtoUtils](https://developer.android.com/reference/android/support/test/espresso/remote/ProtoUtils)
  - [RemoteDescriptor](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor)
  - [RemoteDescriptor.Builder](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptor.Builder)
  - [RemoteDescriptorRegistry](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteDescriptorRegistry)
  - [RemoteInteractionRegistry](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteInteractionRegistry)
  - [TypeProtoConverters](https://developer.android.com/reference/android/support/test/espresso/remote/TypeProtoConverters)
-

  ## Enums

  - [InteractionResponse.Status](https://developer.android.com/reference/android/support/test/espresso/remote/InteractionResponse.Status)
-

  ## Exceptions

  - [NoRemoteEspressoInstanceException](https://developer.android.com/reference/android/support/test/espresso/remote/NoRemoteEspressoInstanceException)
  - [RemoteEspressoException](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteEspressoException)
  - [RemoteProtocolException](https://developer.android.com/reference/android/support/test/espresso/remote/RemoteProtocolException)