public static final class PluginProtos.CodeGeneratorRequest.Builder extends GeneratedMessageV3.Builder<PluginProtos.CodeGeneratorRequest.Builder> implements PluginProtos.CodeGeneratorRequestOrBuilder
An encoded CodeGeneratorRequest is written to the plugin's stdin.
Protobuf type google.protobuf.compiler.CodeGeneratorRequest
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > PluginProtos.CodeGeneratorRequest.BuilderImplements
PluginProtos.CodeGeneratorRequestOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns | |
---|---|
Type | Description |
Descriptors.Descriptor |
Methods
addAllFileToGenerate(Iterable<String> values)
public PluginProtos.CodeGeneratorRequest.Builder addAllFileToGenerate(Iterable<String> values)
The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.
repeated string file_to_generate = 1;
Parameter | |
---|---|
Name | Description |
values | Iterable<String> The fileToGenerate to add. |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder | This builder for chaining. |
addAllProtoFile(Iterable<? extends DescriptorProtos.FileDescriptorProto> values)
public PluginProtos.CodeGeneratorRequest.Builder addAllProtoFile(Iterable<? extends DescriptorProtos.FileDescriptorProto> values)
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Parameter | |
---|---|
Name | Description |
values | Iterable<? extends com.google.protobuf.DescriptorProtos.FileDescriptorProto> |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
addFileToGenerate(String value)
public PluginProtos.CodeGeneratorRequest.Builder addFileToGenerate(String value)
The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.
repeated string file_to_generate = 1;
Parameter | |
---|---|
Name | Description |
value | String The fileToGenerate to add. |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder | This builder for chaining. |
addFileToGenerateBytes(ByteString value)
public PluginProtos.CodeGeneratorRequest.Builder addFileToGenerateBytes(ByteString value)
The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.
repeated string file_to_generate = 1;
Parameter | |
---|---|
Name | Description |
value | ByteString The bytes of the fileToGenerate to add. |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder | This builder for chaining. |
addProtoFile(DescriptorProtos.FileDescriptorProto value)
public PluginProtos.CodeGeneratorRequest.Builder addProtoFile(DescriptorProtos.FileDescriptorProto value)
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Parameter | |
---|---|
Name | Description |
value | DescriptorProtos.FileDescriptorProto |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
addProtoFile(DescriptorProtos.FileDescriptorProto.Builder builderForValue)
public PluginProtos.CodeGeneratorRequest.Builder addProtoFile(DescriptorProtos.FileDescriptorProto.Builder builderForValue)
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Parameter | |
---|---|
Name | Description |
builderForValue | DescriptorProtos.FileDescriptorProto.Builder |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
addProtoFile(int index, DescriptorProtos.FileDescriptorProto value)
public PluginProtos.CodeGeneratorRequest.Builder addProtoFile(int index, DescriptorProtos.FileDescriptorProto value)
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Parameters | |
---|---|
Name | Description |
index | int |
value | DescriptorProtos.FileDescriptorProto |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
addProtoFile(int index, DescriptorProtos.FileDescriptorProto.Builder builderForValue)
public PluginProtos.CodeGeneratorRequest.Builder addProtoFile(int index, DescriptorProtos.FileDescriptorProto.Builder builderForValue)
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Parameters | |
---|---|
Name | Description |
index | int |
builderForValue | DescriptorProtos.FileDescriptorProto.Builder |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
addProtoFileBuilder()
public DescriptorProtos.FileDescriptorProto.Builder addProtoFileBuilder()
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Returns | |
---|---|
Type | Description |
DescriptorProtos.FileDescriptorProto.Builder |
addProtoFileBuilder(int index)
public DescriptorProtos.FileDescriptorProto.Builder addProtoFileBuilder(int index)
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Parameter | |
---|---|
Name | Description |
index | int |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FileDescriptorProto.Builder |
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public PluginProtos.CodeGeneratorRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field | Descriptors.FieldDescriptor |
value | Object |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
build()
public PluginProtos.CodeGeneratorRequest build()
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest |
buildPartial()
public PluginProtos.CodeGeneratorRequest buildPartial()
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest |
clear()
public PluginProtos.CodeGeneratorRequest.Builder clear()
Called by the initialization and clear code paths to allow subclasses to reset any of their builtin fields back to the initial values.
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
clearCompilerVersion()
public PluginProtos.CodeGeneratorRequest.Builder clearCompilerVersion()
The version number of protocol compiler.
optional .google.protobuf.compiler.Version compiler_version = 3;
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
clearField(Descriptors.FieldDescriptor field)
public PluginProtos.CodeGeneratorRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter | |
---|---|
Name | Description |
field | Descriptors.FieldDescriptor |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
clearFileToGenerate()
public PluginProtos.CodeGeneratorRequest.Builder clearFileToGenerate()
The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.
repeated string file_to_generate = 1;
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder | This builder for chaining. |
clearOneof(Descriptors.OneofDescriptor oneof)
public PluginProtos.CodeGeneratorRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
TODO(jieluo): Clear it when all subclasses have implemented this method.
Parameter | |
---|---|
Name | Description |
oneof | Descriptors.OneofDescriptor |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
clearParameter()
public PluginProtos.CodeGeneratorRequest.Builder clearParameter()
The generator parameter passed on the command-line.
optional string parameter = 2;
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder | This builder for chaining. |
clearProtoFile()
public PluginProtos.CodeGeneratorRequest.Builder clearProtoFile()
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
clone()
public PluginProtos.CodeGeneratorRequest.Builder clone()
Clones the Builder.
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
getCompilerVersion()
public PluginProtos.Version getCompilerVersion()
The version number of protocol compiler.
optional .google.protobuf.compiler.Version compiler_version = 3;
Returns | |
---|---|
Type | Description |
PluginProtos.Version | The compilerVersion. |
getCompilerVersionBuilder()
public PluginProtos.Version.Builder getCompilerVersionBuilder()
The version number of protocol compiler.
optional .google.protobuf.compiler.Version compiler_version = 3;
Returns | |
---|---|
Type | Description |
PluginProtos.Version.Builder |
getCompilerVersionOrBuilder()
public PluginProtos.VersionOrBuilder getCompilerVersionOrBuilder()
The version number of protocol compiler.
optional .google.protobuf.compiler.Version compiler_version = 3;
Returns | |
---|---|
Type | Description |
PluginProtos.VersionOrBuilder |
getDefaultInstanceForType()
public PluginProtos.CodeGeneratorRequest getDefaultInstanceForType()
Get an instance of the type with no fields set. Because no fields are set, all getters for
singular fields will return default values and repeated fields will appear empty. This may or
may not be a singleton. This differs from the getDefaultInstance()
method of generated
message classes in that this method is an abstract method of the MessageLite
interface
whereas getDefaultInstance()
is a static method of a specific class. They return the
same thing.
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Get the message's type's descriptor. This differs from the getDescriptor()
method of
generated message classes in that this method is an abstract method of the Message
interface whereas getDescriptor()
is a static method of a specific class. They return
the same thing.
Returns | |
---|---|
Type | Description |
Descriptors.Descriptor |
getFileToGenerate(int index)
public String getFileToGenerate(int index)
The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.
repeated string file_to_generate = 1;
Parameter | |
---|---|
Name | Description |
index | int The index of the element to return. |
Returns | |
---|---|
Type | Description |
String | The fileToGenerate at the given index. |
getFileToGenerateBytes(int index)
public ByteString getFileToGenerateBytes(int index)
The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.
repeated string file_to_generate = 1;
Parameter | |
---|---|
Name | Description |
index | int The index of the value to return. |
Returns | |
---|---|
Type | Description |
ByteString | The bytes of the fileToGenerate at the given index. |
getFileToGenerateCount()
public int getFileToGenerateCount()
The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.
repeated string file_to_generate = 1;
Returns | |
---|---|
Type | Description |
int | The count of fileToGenerate. |
getFileToGenerateList()
public ProtocolStringList getFileToGenerateList()
The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.
repeated string file_to_generate = 1;
Returns | |
---|---|
Type | Description |
ProtocolStringList | A list containing the fileToGenerate. |
getParameter()
public String getParameter()
The generator parameter passed on the command-line.
optional string parameter = 2;
Returns | |
---|---|
Type | Description |
String | The parameter. |
getParameterBytes()
public ByteString getParameterBytes()
The generator parameter passed on the command-line.
optional string parameter = 2;
Returns | |
---|---|
Type | Description |
ByteString | The bytes for parameter. |
getProtoFile(int index)
public DescriptorProtos.FileDescriptorProto getProtoFile(int index)
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Parameter | |
---|---|
Name | Description |
index | int |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FileDescriptorProto |
getProtoFileBuilder(int index)
public DescriptorProtos.FileDescriptorProto.Builder getProtoFileBuilder(int index)
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Parameter | |
---|---|
Name | Description |
index | int |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FileDescriptorProto.Builder |
getProtoFileBuilderList()
public List<DescriptorProtos.FileDescriptorProto.Builder> getProtoFileBuilderList()
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Returns | |
---|---|
Type | Description |
List<Builder> |
getProtoFileCount()
public int getProtoFileCount()
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Returns | |
---|---|
Type | Description |
int |
getProtoFileList()
public List<DescriptorProtos.FileDescriptorProto> getProtoFileList()
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Returns | |
---|---|
Type | Description |
List<FileDescriptorProto> |
getProtoFileOrBuilder(int index)
public DescriptorProtos.FileDescriptorProtoOrBuilder getProtoFileOrBuilder(int index)
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Parameter | |
---|---|
Name | Description |
index | int |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FileDescriptorProtoOrBuilder |
getProtoFileOrBuilderList()
public List<? extends DescriptorProtos.FileDescriptorProtoOrBuilder> getProtoFileOrBuilderList()
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Returns | |
---|---|
Type | Description |
List<? extends com.google.protobuf.DescriptorProtos.FileDescriptorProtoOrBuilder> |
hasCompilerVersion()
public boolean hasCompilerVersion()
The version number of protocol compiler.
optional .google.protobuf.compiler.Version compiler_version = 3;
Returns | |
---|---|
Type | Description |
boolean | Whether the compilerVersion field is set. |
hasParameter()
public boolean hasParameter()
The generator parameter passed on the command-line.
optional string parameter = 2;
Returns | |
---|---|
Type | Description |
boolean | Whether the parameter field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Get the FieldAccessorTable for this type. We can't have the message class pass this in to the constructor because of bootstrapping trouble with DescriptorProtos.
Returns | |
---|---|
Type | Description |
GeneratedMessageV3.FieldAccessorTable |
isInitialized()
public final boolean isInitialized()
Returns true if all required fields in the message and all embedded messages are set, false otherwise.
Returns | |
---|---|
Type | Description |
boolean |
mergeCompilerVersion(PluginProtos.Version value)
public PluginProtos.CodeGeneratorRequest.Builder mergeCompilerVersion(PluginProtos.Version value)
The version number of protocol compiler.
optional .google.protobuf.compiler.Version compiler_version = 3;
Parameter | |
---|---|
Name | Description |
value | PluginProtos.Version |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public PluginProtos.CodeGeneratorRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Like Builder#mergeFrom(CodedInputStream), but also parses extensions. The extensions
that you want to be able to parse must be registered in extensionRegistry
. Extensions
not in the registry will be treated as unknown fields.
Parameters | |
---|---|
Name | Description |
input | CodedInputStream |
extensionRegistry | ExtensionRegistryLite |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
Exceptions | |
---|---|
Type | Description |
IOException |
mergeFrom(Message other)
public PluginProtos.CodeGeneratorRequest.Builder mergeFrom(Message other)
Merge other
into the message being built. other
must have the exact same type
as this
(i.e. getDescriptorForType() == other.getDescriptorForType()
).
Merging occurs as follows. For each field:
- For singular primitive fields, if the field is set in
other
, thenother
's value overwrites the value in this message. - For singular message fields, if the field is set in
other
, it is merged into the corresponding sub-message of this message using the same merging rules. - For repeated fields, the elements in
other
are concatenated with the elements in this message. For oneof groups, if the other message has one of the fields set, the group of this message is cleared and replaced by the field of the other message, so that the oneof constraint is preserved.
This is equivalent to the
Message::MergeFrom
method in C++.
Parameter | |
---|---|
Name | Description |
other | Message |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
mergeFrom(PluginProtos.CodeGeneratorRequest other)
public PluginProtos.CodeGeneratorRequest.Builder mergeFrom(PluginProtos.CodeGeneratorRequest other)
Parameter | |
---|---|
Name | Description |
other | PluginProtos.CodeGeneratorRequest |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final PluginProtos.CodeGeneratorRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Merge some unknown fields into the UnknownFieldSet for this message.
Parameter | |
---|---|
Name | Description |
unknownFields | UnknownFieldSet |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
removeProtoFile(int index)
public PluginProtos.CodeGeneratorRequest.Builder removeProtoFile(int index)
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Parameter | |
---|---|
Name | Description |
index | int |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
setCompilerVersion(PluginProtos.Version value)
public PluginProtos.CodeGeneratorRequest.Builder setCompilerVersion(PluginProtos.Version value)
The version number of protocol compiler.
optional .google.protobuf.compiler.Version compiler_version = 3;
Parameter | |
---|---|
Name | Description |
value | PluginProtos.Version |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
setCompilerVersion(PluginProtos.Version.Builder builderForValue)
public PluginProtos.CodeGeneratorRequest.Builder setCompilerVersion(PluginProtos.Version.Builder builderForValue)
The version number of protocol compiler.
optional .google.protobuf.compiler.Version compiler_version = 3;
Parameter | |
---|---|
Name | Description |
builderForValue | PluginProtos.Version.Builder |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
setField(Descriptors.FieldDescriptor field, Object value)
public PluginProtos.CodeGeneratorRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field | Descriptors.FieldDescriptor |
value | Object |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
setFileToGenerate(int index, String value)
public PluginProtos.CodeGeneratorRequest.Builder setFileToGenerate(int index, String value)
The .proto files that were explicitly listed on the command-line. The code generator should generate code only for these files. Each file's descriptor will be included in proto_file, below.
repeated string file_to_generate = 1;
Parameters | |
---|---|
Name | Description |
index | int The index to set the value at. |
value | String The fileToGenerate to set. |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder | This builder for chaining. |
setParameter(String value)
public PluginProtos.CodeGeneratorRequest.Builder setParameter(String value)
The generator parameter passed on the command-line.
optional string parameter = 2;
Parameter | |
---|---|
Name | Description |
value | String The parameter to set. |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder | This builder for chaining. |
setParameterBytes(ByteString value)
public PluginProtos.CodeGeneratorRequest.Builder setParameterBytes(ByteString value)
The generator parameter passed on the command-line.
optional string parameter = 2;
Parameter | |
---|---|
Name | Description |
value | ByteString The bytes for parameter to set. |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder | This builder for chaining. |
setProtoFile(int index, DescriptorProtos.FileDescriptorProto value)
public PluginProtos.CodeGeneratorRequest.Builder setProtoFile(int index, DescriptorProtos.FileDescriptorProto value)
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Parameters | |
---|---|
Name | Description |
index | int |
value | DescriptorProtos.FileDescriptorProto |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
setProtoFile(int index, DescriptorProtos.FileDescriptorProto.Builder builderForValue)
public PluginProtos.CodeGeneratorRequest.Builder setProtoFile(int index, DescriptorProtos.FileDescriptorProto.Builder builderForValue)
FileDescriptorProtos for all files in files_to_generate and everything they import. The files will appear in topological order, so each file appears before any file that imports it. protoc guarantees that all proto_files will be written after the fields above, even though this is not technically guaranteed by the protobuf wire format. This theoretically could allow a plugin to stream in the FileDescriptorProtos and handle them one by one rather than read the entire set into memory at once. However, as of this writing, this is not similarly optimized on protoc's end -- it will store all fields in memory at once before sending them to the plugin. Type names of fields and extensions in the FileDescriptorProto are always fully qualified.
repeated .google.protobuf.FileDescriptorProto proto_file = 15;
Parameters | |
---|---|
Name | Description |
index | int |
builderForValue | DescriptorProtos.FileDescriptorProto.Builder |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public PluginProtos.CodeGeneratorRequest.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters | |
---|---|
Name | Description |
field | Descriptors.FieldDescriptor |
index | int |
value | Object |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |
setUnknownFields(UnknownFieldSet unknownFields)
public final PluginProtos.CodeGeneratorRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields | UnknownFieldSet |
Returns | |
---|---|
Type | Description |
PluginProtos.CodeGeneratorRequest.Builder |