public static final class PluginProtos.CodeGeneratorResponse.Builder extends GeneratedMessageV3.Builder<PluginProtos.CodeGeneratorResponse.Builder> implements PluginProtos.CodeGeneratorResponseOrBuilder
The plugin writes an encoded CodeGeneratorResponse to stdout.
Protobuf type google.protobuf.compiler.CodeGeneratorResponse
Static Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Methods
addAllFile(Iterable<? extends PluginProtos.CodeGeneratorResponse.File> values)
public PluginProtos.CodeGeneratorResponse.Builder addAllFile(Iterable<? extends PluginProtos.CodeGeneratorResponse.File> values)
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
Parameter |
---|
Name | Description |
values | Iterable<? extends com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse.File>
|
addFile(PluginProtos.CodeGeneratorResponse.File value)
public PluginProtos.CodeGeneratorResponse.Builder addFile(PluginProtos.CodeGeneratorResponse.File value)
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
addFile(PluginProtos.CodeGeneratorResponse.File.Builder builderForValue)
public PluginProtos.CodeGeneratorResponse.Builder addFile(PluginProtos.CodeGeneratorResponse.File.Builder builderForValue)
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
addFile(int index, PluginProtos.CodeGeneratorResponse.File value)
public PluginProtos.CodeGeneratorResponse.Builder addFile(int index, PluginProtos.CodeGeneratorResponse.File value)
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
addFile(int index, PluginProtos.CodeGeneratorResponse.File.Builder builderForValue)
public PluginProtos.CodeGeneratorResponse.Builder addFile(int index, PluginProtos.CodeGeneratorResponse.File.Builder builderForValue)
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
addFileBuilder()
public PluginProtos.CodeGeneratorResponse.File.Builder addFileBuilder()
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
addFileBuilder(int index)
public PluginProtos.CodeGeneratorResponse.File.Builder addFileBuilder(int index)
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
Parameter |
---|
Name | Description |
index | int
|
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public PluginProtos.CodeGeneratorResponse.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Overrides
build()
public PluginProtos.CodeGeneratorResponse build()
buildPartial()
public PluginProtos.CodeGeneratorResponse buildPartial()
clear()
public PluginProtos.CodeGeneratorResponse.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.
Overrides
clearError()
public PluginProtos.CodeGeneratorResponse.Builder clearError()
Error message. If non-empty, code generation failed. The plugin process
should exit with status code zero even if it reports an error in this way.
This should be used to indicate errors in .proto files which prevent the
code generator from generating correct code. Errors which indicate a
problem in protoc itself -- such as the input CodeGeneratorRequest being
unparseable -- should be reported by writing a message to stderr and
exiting with a non-zero status code.
optional string error = 1;
clearField(Descriptors.FieldDescriptor field)
public PluginProtos.CodeGeneratorResponse.Builder clearField(Descriptors.FieldDescriptor field)
Overrides
clearFile()
public PluginProtos.CodeGeneratorResponse.Builder clearFile()
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
clearOneof(Descriptors.OneofDescriptor oneof)
public PluginProtos.CodeGeneratorResponse.Builder clearOneof(Descriptors.OneofDescriptor oneof)
TODO(jieluo): Clear it when all subclasses have implemented this method.
Overrides
clearSupportedFeatures()
public PluginProtos.CodeGeneratorResponse.Builder clearSupportedFeatures()
A bitmask of supported features that the code generator supports.
This is a bitwise "or" of values from the Feature enum.
optional uint64 supported_features = 2;
clone()
public PluginProtos.CodeGeneratorResponse.Builder clone()
Overrides
getDefaultInstanceForType()
public PluginProtos.CodeGeneratorResponse 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.
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.
Overrides
getError()
Error message. If non-empty, code generation failed. The plugin process
should exit with status code zero even if it reports an error in this way.
This should be used to indicate errors in .proto files which prevent the
code generator from generating correct code. Errors which indicate a
problem in protoc itself -- such as the input CodeGeneratorRequest being
unparseable -- should be reported by writing a message to stderr and
exiting with a non-zero status code.
optional string error = 1;
Returns |
---|
Type | Description |
String | The error.
|
getErrorBytes()
public ByteString getErrorBytes()
Error message. If non-empty, code generation failed. The plugin process
should exit with status code zero even if it reports an error in this way.
This should be used to indicate errors in .proto files which prevent the
code generator from generating correct code. Errors which indicate a
problem in protoc itself -- such as the input CodeGeneratorRequest being
unparseable -- should be reported by writing a message to stderr and
exiting with a non-zero status code.
optional string error = 1;
Returns |
---|
Type | Description |
ByteString | The bytes for error.
|
getFile(int index)
public PluginProtos.CodeGeneratorResponse.File getFile(int index)
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
Parameter |
---|
Name | Description |
index | int
|
getFileBuilder(int index)
public PluginProtos.CodeGeneratorResponse.File.Builder getFileBuilder(int index)
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
Parameter |
---|
Name | Description |
index | int
|
getFileBuilderList()
public List<PluginProtos.CodeGeneratorResponse.File.Builder> getFileBuilderList()
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
getFileCount()
public int getFileCount()
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
Returns |
---|
Type | Description |
int | |
getFileList()
public List<PluginProtos.CodeGeneratorResponse.File> getFileList()
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
getFileOrBuilder(int index)
public PluginProtos.CodeGeneratorResponse.FileOrBuilder getFileOrBuilder(int index)
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
Parameter |
---|
Name | Description |
index | int
|
getFileOrBuilderList()
public List<? extends PluginProtos.CodeGeneratorResponse.FileOrBuilder> getFileOrBuilderList()
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
Returns |
---|
Type | Description |
List<? extends com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse.FileOrBuilder> | |
getSupportedFeatures()
public long getSupportedFeatures()
A bitmask of supported features that the code generator supports.
This is a bitwise "or" of values from the Feature enum.
optional uint64 supported_features = 2;
Returns |
---|
Type | Description |
long | The supportedFeatures.
|
hasError()
public boolean hasError()
Error message. If non-empty, code generation failed. The plugin process
should exit with status code zero even if it reports an error in this way.
This should be used to indicate errors in .proto files which prevent the
code generator from generating correct code. Errors which indicate a
problem in protoc itself -- such as the input CodeGeneratorRequest being
unparseable -- should be reported by writing a message to stderr and
exiting with a non-zero status code.
optional string error = 1;
Returns |
---|
Type | Description |
boolean | Whether the error field is set.
|
hasSupportedFeatures()
public boolean hasSupportedFeatures()
A bitmask of supported features that the code generator supports.
This is a bitwise "or" of values from the Feature enum.
optional uint64 supported_features = 2;
Returns |
---|
Type | Description |
boolean | Whether the supportedFeatures 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.
Overrides
isInitialized()
public final boolean isInitialized()
Overrides
public PluginProtos.CodeGeneratorResponse.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.
Overrides
mergeFrom(Message other)
public PluginProtos.CodeGeneratorResponse.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
, then other
'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
|
Overrides
mergeFrom(PluginProtos.CodeGeneratorResponse other)
public PluginProtos.CodeGeneratorResponse.Builder mergeFrom(PluginProtos.CodeGeneratorResponse other)
mergeUnknownFields(UnknownFieldSet unknownFields)
public final PluginProtos.CodeGeneratorResponse.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Overrides
removeFile(int index)
public PluginProtos.CodeGeneratorResponse.Builder removeFile(int index)
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
Parameter |
---|
Name | Description |
index | int
|
setError(String value)
public PluginProtos.CodeGeneratorResponse.Builder setError(String value)
Error message. If non-empty, code generation failed. The plugin process
should exit with status code zero even if it reports an error in this way.
This should be used to indicate errors in .proto files which prevent the
code generator from generating correct code. Errors which indicate a
problem in protoc itself -- such as the input CodeGeneratorRequest being
unparseable -- should be reported by writing a message to stderr and
exiting with a non-zero status code.
optional string error = 1;
Parameter |
---|
Name | Description |
value | String
The error to set.
|
setErrorBytes(ByteString value)
public PluginProtos.CodeGeneratorResponse.Builder setErrorBytes(ByteString value)
Error message. If non-empty, code generation failed. The plugin process
should exit with status code zero even if it reports an error in this way.
This should be used to indicate errors in .proto files which prevent the
code generator from generating correct code. Errors which indicate a
problem in protoc itself -- such as the input CodeGeneratorRequest being
unparseable -- should be reported by writing a message to stderr and
exiting with a non-zero status code.
optional string error = 1;
Parameter |
---|
Name | Description |
value | ByteString
The bytes for error to set.
|
setField(Descriptors.FieldDescriptor field, Object value)
public PluginProtos.CodeGeneratorResponse.Builder setField(Descriptors.FieldDescriptor field, Object value)
Overrides
setFile(int index, PluginProtos.CodeGeneratorResponse.File value)
public PluginProtos.CodeGeneratorResponse.Builder setFile(int index, PluginProtos.CodeGeneratorResponse.File value)
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
setFile(int index, PluginProtos.CodeGeneratorResponse.File.Builder builderForValue)
public PluginProtos.CodeGeneratorResponse.Builder setFile(int index, PluginProtos.CodeGeneratorResponse.File.Builder builderForValue)
repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public PluginProtos.CodeGeneratorResponse.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Overrides
setSupportedFeatures(long value)
public PluginProtos.CodeGeneratorResponse.Builder setSupportedFeatures(long value)
A bitmask of supported features that the code generator supports.
This is a bitwise "or" of values from the Feature enum.
optional uint64 supported_features = 2;
Parameter |
---|
Name | Description |
value | long
The supportedFeatures to set.
|
setUnknownFields(UnknownFieldSet unknownFields)
public final PluginProtos.CodeGeneratorResponse.Builder setUnknownFields(UnknownFieldSet unknownFields)
Overrides