RemoteDescriptorRegistry


public final class RemoteDescriptorRegistry


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

Summary

Public methods

RemoteDescriptor
RemoteDescriptor
RemoteDescriptor

Returns an RemoteDescriptor by its any type url.

static RemoteDescriptorRegistry

Returns a RemoteDescriptorRegistry object

boolean

Checks if an instance type is registered with this registry.

boolean
registerRemoteTypeArgs(
    @NonNull List<RemoteDescriptor> remoteDescriptors
)
void

Public methods

argForInstanceType

public RemoteDescriptor argForInstanceType(@NonNull Class<Object> targetType)
Returns
RemoteDescriptor

an RemoteDescriptor object by its target type.

argForMsgType

public RemoteDescriptor argForMsgType(@NonNull Class<Object> protoMsgType)
Returns
RemoteDescriptor

an RemoteDescriptor object by its proto message type.

argForRemoteTypeUrl

public RemoteDescriptor argForRemoteTypeUrl(@NonNull 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!

Returns
RemoteDescriptor

an RemoteDescriptor object by its remote type url.

getInstance

public static RemoteDescriptorRegistry getInstance()

Returns a RemoteDescriptorRegistry object

Returns
RemoteDescriptorRegistry

an instance of RemoteDescriptorRegistry object.

hasArgForInstanceType

public boolean hasArgForInstanceType(@NonNull Class<Object> instanceType)

Checks if an instance type is registered with this registry.

Parameters
@NonNull Class<Object> instanceType

the instance to check

Returns
boolean

true if a RemoteDescriptor is registered for instance type

registerRemoteTypeArgs

public boolean registerRemoteTypeArgs(
    @NonNull List<RemoteDescriptor> remoteDescriptors
)

unregisterRemoteTypeArgs

public void unregisterRemoteTypeArgs(
    @NonNull List<RemoteDescriptor> remoteDescriptors
)