RemoteDescriptorRegistry

public final class RemoteDescriptorRegistry
extends Object

java.lang.Object
   ↳ androidx.test.espresso.remote.RemoteDescriptorRegistry


A registry for registering remote descriptors. Remote descriptors are registered in the form of a RemoteDescriptor object.

Summary

Public methods

RemoteDescriptor argForInstanceType(Class<?> targetType)
RemoteDescriptor argForMsgType(Class<?> protoMsgType)
RemoteDescriptor argForRemoteTypeUrl(String typeUrl)

Returns an RemoteDescriptor by its any type url.

static RemoteDescriptorRegistry getInstance()

Returns a RemoteDescriptorRegistry object

boolean hasArgForInstanceType(Class<?> instanceType)

Checks if an instance type is registered with this registry.

boolean registerRemoteTypeArgs(List<RemoteDescriptor> remoteDescriptors)
void unregisterRemoteTypeArgs(List<RemoteDescriptor> remoteDescriptors)

Inherited methods

From class java.lang.Object

Public methods

argForInstanceType

RemoteDescriptor argForInstanceType (Class<?> targetType)

Parameters
targetType Class

Returns
RemoteDescriptor an RemoteDescriptor object by its target type.

argForMsgType

RemoteDescriptor argForMsgType (Class<?> protoMsgType)

Parameters
protoMsgType Class

Returns
RemoteDescriptor an RemoteDescriptor object by its proto message type.

argForRemoteTypeUrl

RemoteDescriptor argForRemoteTypeUrl (String typeUrl)

Returns an RemoteDescriptor by its any type url. The any type url in this case must match the remote type class, which knows how to convert a class to and from its target type!

Parameters
typeUrl String

Returns
RemoteDescriptor an RemoteDescriptor object by its remote type url.

getInstance

RemoteDescriptorRegistry getInstance ()

Returns a RemoteDescriptorRegistry object

Returns
RemoteDescriptorRegistry an instance of RemoteDescriptorRegistry object.

hasArgForInstanceType

boolean hasArgForInstanceType (Class<?> instanceType)

Checks if an instance type is registered with this registry.

Parameters
instanceType Class: the instance to check

Returns
boolean true if a RemoteDescriptor is registered for instance type

registerRemoteTypeArgs

boolean registerRemoteTypeArgs (List<RemoteDescriptor> remoteDescriptors)

Parameters
remoteDescriptors List

Returns
boolean

unregisterRemoteTypeArgs

void unregisterRemoteTypeArgs (List<RemoteDescriptor> remoteDescriptors)

Parameters
remoteDescriptors List