Class TypeRegistry (3.19.4)

public class TypeRegistry

A TypeRegistry is used to resolve Any messages. You must provide a TypeRegistry containing all message types used in Any message fields.

Inheritance

java.lang.Object > TypeRegistry

Static Methods

getEmptyTypeRegistry()

public static TypeRegistry getEmptyTypeRegistry()
Returns
TypeDescription
TypeRegistry

newBuilder()

public static TypeRegistry.Builder newBuilder()
Returns
TypeDescription
TypeRegistry.Builder

Methods

find(String name)

public Descriptors.Descriptor find(String name)

Find a type by its full name. Returns null if it cannot be found in this TypeRegistry.

Parameter
NameDescription
nameString
Returns
TypeDescription
Descriptors.Descriptor

getDescriptorForTypeUrl(String typeUrl)

public final Descriptors.Descriptor getDescriptorForTypeUrl(String typeUrl)

Find a type by its typeUrl. Returns null if it cannot be found in this TypeRegistry.

Parameter
NameDescription
typeUrlString
Returns
TypeDescription
Descriptors.Descriptor
Exceptions
TypeDescription
InvalidProtocolBufferException