public final class

RemoteDescriptor.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.test.espresso.remote.RemoteDescriptor.Builder

Overview

Builder for RemoteDescriptor

Summary

Constructors
publicBuilder()

Methods
public RemoteDescriptorbuild()

Builds a RemoteDescriptor from the builder properties set.

public RemoteDescriptor.BuildersetInstanceFieldDescriptors(FieldDescriptor fieldDescriptors[])

Sets the FieldDescriptors associated with this RemoteDescriptor.

public RemoteDescriptor.BuildersetInstanceType(java.lang.Class<java.lang.Object> instanceType)

Sets the instance type for associated with this RemoteDescriptor.

public RemoteDescriptor.BuildersetProtoBuilderType(java.lang.Class<java.lang.Object> protoBuilderType)

Sets the type of the proto message builder associated with this RemoteDescriptor.

public RemoteDescriptor.BuildersetProtoParser(<any> protoParser)

Sets the type of the proto message parser associated with this RemoteDescriptor.

public RemoteDescriptor.BuildersetProtoType(java.lang.Class<java.lang.Object> protoType)

Sets the type of the proto message associated with this RemoteDescriptor.

public RemoteDescriptor.BuildersetRemoteConstrTypes(java.lang.Class<java.lang.Object> remoteConstrTypes[])

Sets the remote constructor types of the EspressoRemoteMessage associated with this RemoteDescriptor.

public RemoteDescriptor.BuildersetRemoteType(java.lang.Class<java.lang.Object> remoteType)

Sets the type of the EspressoRemoteMessage associated with this RemoteDescriptor.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Methods

public RemoteDescriptor.Builder setInstanceType(java.lang.Class<java.lang.Object> instanceType)

Sets the instance type for associated with this RemoteDescriptor.

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

Parameters:

instanceType:

Returns:

fluent builder interface

public RemoteDescriptor.Builder setInstanceFieldDescriptors(FieldDescriptor fieldDescriptors[])

Sets the FieldDescriptors associated with this RemoteDescriptor.

The field descriptor order, must match the instanceTypes declared constructor parameter order.

Note: Any field descriptors passed to this method will be overwritten by field descriptors annotated with .

Parameters:

fieldDescriptors:

Returns:

fluent builder interface

public RemoteDescriptor.Builder setRemoteType(java.lang.Class<java.lang.Object> remoteType)

Sets the type of the EspressoRemoteMessage associated with this RemoteDescriptor.

Parameters:

remoteType: the remote message class

Returns:

fluent builder interface

public RemoteDescriptor.Builder setRemoteConstrTypes(java.lang.Class<java.lang.Object> remoteConstrTypes[])

Sets the remote constructor types of the EspressoRemoteMessage associated with this 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.

Parameters:

remoteConstrTypes:

Returns:

fluent builder interface

public RemoteDescriptor.Builder setProtoType(java.lang.Class<java.lang.Object> protoType)

Sets the type of the proto message associated with this RemoteDescriptor.

Parameters:

protoType: the proto message class

Returns:

fluent builder interface

public RemoteDescriptor.Builder setProtoBuilderType(java.lang.Class<java.lang.Object> protoBuilderType)

Sets the type of the proto message builder associated with this RemoteDescriptor.

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

Parameters:

protoBuilderType: the proto message builder class

Returns:

fluent builder interface

public RemoteDescriptor.Builder setProtoParser(<any> protoParser)

Sets the type of the proto message parser associated with this RemoteDescriptor.

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

Parameters:

protoParser: the proto parser

Returns:

fluent builder interface

public RemoteDescriptor build()

Builds a RemoteDescriptor from the builder properties set.