Class JsonFormat.TypeRegistry.Builder (3.19.4)

public static class JsonFormat.TypeRegistry.Builder

A Builder is used to build TypeRegistry.

Inheritance

java.lang.Object > JsonFormat.TypeRegistry.Builder

Methods

add(Descriptors.Descriptor messageType)

public JsonFormat.TypeRegistry.Builder add(Descriptors.Descriptor messageType)

Adds a message type and all types defined in the same .proto file as well as all transitively imported .proto files to this Builder.

Parameter
NameDescription
messageTypeDescriptors.Descriptor
Returns
TypeDescription
JsonFormat.TypeRegistry.Builder

add(Iterable<Descriptors.Descriptor> messageTypes)

public JsonFormat.TypeRegistry.Builder add(Iterable<Descriptors.Descriptor> messageTypes)

Adds message types and all types defined in the same .proto file as well as all transitively imported .proto files to this Builder.

Parameter
NameDescription
messageTypesIterable<Descriptor>
Returns
TypeDescription
JsonFormat.TypeRegistry.Builder

build()

public JsonFormat.TypeRegistry build()

Builds a TypeRegistry. This method can only be called once for one Builder.

Returns
TypeDescription
JsonFormat.TypeRegistry