Package com.google.protobuf
Class TypeRegistry.Builder
- java.lang.Object
-
- com.google.protobuf.TypeRegistry.Builder
-
- Enclosing class:
- TypeRegistry
public static final class TypeRegistry.Builder extends java.lang.ObjectA Builder is used to buildTypeRegistry.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.String>filesprivate java.util.Map<java.lang.String,Descriptors.Descriptor>types
-
Constructor Summary
Constructors Modifier Constructor Description privateBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeRegistry.Builderadd(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 thisTypeRegistry.Builder.TypeRegistry.Builderadd(java.lang.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 thisTypeRegistry.Builder.private voidaddFile(Descriptors.FileDescriptor file)private voidaddMessage(Descriptors.Descriptor message)TypeRegistrybuild()Builds aTypeRegistry.
-
-
-
Field Detail
-
files
private final java.util.Set<java.lang.String> files
-
types
private java.util.Map<java.lang.String,Descriptors.Descriptor> types
-
-
Method Detail
-
add
@CanIgnoreReturnValue public 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 thisTypeRegistry.Builder.Note: In the case of adding duplicate types, the first one added will be used and subsequent ones will be ignored. Especially if you are dynamically loading FileDesciptors which may redefine the same fully qualified names, you may want to create a layer on top to control your intended behavior in the face of duplicates.
-
add
@CanIgnoreReturnValue public TypeRegistry.Builder add(java.lang.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 thisTypeRegistry.Builder.Note: In the case of adding duplicate types, the first one added will be used and subsequent ones will be ignored. Especially if you are dynamically loading FileDesciptors which may redefine the same fully qualified names, you may want to create a layer on top to control your intended behavior in the face of duplicates.
-
build
public TypeRegistry build()
Builds aTypeRegistry. This method can only be called once for one Builder.
-
addFile
private void addFile(Descriptors.FileDescriptor file)
-
addMessage
private void addMessage(Descriptors.Descriptor message)
-
-