Class PluginProtos.CodeGeneratorResponse.Builder (3.19.4)

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()
Returns
TypeDescription
Descriptors.Descriptor

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
NameDescription
valuesIterable<? extends com.google.protobuf.compiler.PluginProtos.CodeGeneratorResponse.File>
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder

addFile(PluginProtos.CodeGeneratorResponse.File value)

public PluginProtos.CodeGeneratorResponse.Builder addFile(PluginProtos.CodeGeneratorResponse.File value)

repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;

Parameter
NameDescription
valuePluginProtos.CodeGeneratorResponse.File
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder

addFile(PluginProtos.CodeGeneratorResponse.File.Builder builderForValue)

public PluginProtos.CodeGeneratorResponse.Builder addFile(PluginProtos.CodeGeneratorResponse.File.Builder builderForValue)

repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;

Parameter
NameDescription
builderForValuePluginProtos.CodeGeneratorResponse.File.Builder
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder

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;

Parameters
NameDescription
indexint
valuePluginProtos.CodeGeneratorResponse.File
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder

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;

Parameters
NameDescription
indexint
builderForValuePluginProtos.CodeGeneratorResponse.File.Builder
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder

addFileBuilder()

public PluginProtos.CodeGeneratorResponse.File.Builder addFileBuilder()

repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;

Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.File.Builder

addFileBuilder(int index)

public PluginProtos.CodeGeneratorResponse.File.Builder addFileBuilder(int index)

repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;

Parameter
NameDescription
indexint
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.File.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public PluginProtos.CodeGeneratorResponse.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldDescriptors.FieldDescriptor
valueObject
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder
Overrides

build()

public PluginProtos.CodeGeneratorResponse build()
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse

buildPartial()

public PluginProtos.CodeGeneratorResponse buildPartial()
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse

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.

Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder
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;

Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public PluginProtos.CodeGeneratorResponse.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldDescriptors.FieldDescriptor
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder
Overrides

clearFile()

public PluginProtos.CodeGeneratorResponse.Builder clearFile()

repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;

Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public PluginProtos.CodeGeneratorResponse.Builder clearOneof(Descriptors.OneofDescriptor oneof)

TODO(jieluo): Clear it when all subclasses have implemented this method.

Parameter
NameDescription
oneofDescriptors.OneofDescriptor
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder
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;

Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder

This builder for chaining.

clone()

public PluginProtos.CodeGeneratorResponse.Builder clone()

Clones the Builder.

Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder
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.

Returns
TypeDescription
PluginProtos.CodeGeneratorResponse

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
TypeDescription
Descriptors.Descriptor
Overrides

getError()

public String 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
TypeDescription
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
TypeDescription
ByteString

The bytes for error.

getFile(int index)

public PluginProtos.CodeGeneratorResponse.File getFile(int index)

repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;

Parameter
NameDescription
indexint
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.File

getFileBuilder(int index)

public PluginProtos.CodeGeneratorResponse.File.Builder getFileBuilder(int index)

repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;

Parameter
NameDescription
indexint
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.File.Builder

getFileBuilderList()

public List<PluginProtos.CodeGeneratorResponse.File.Builder> getFileBuilderList()

repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;

Returns
TypeDescription
List<Builder>

getFileCount()

public int getFileCount()

repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;

Returns
TypeDescription
int

getFileList()

public List<PluginProtos.CodeGeneratorResponse.File> getFileList()

repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;

Returns
TypeDescription
List<File>

getFileOrBuilder(int index)

public PluginProtos.CodeGeneratorResponse.FileOrBuilder getFileOrBuilder(int index)

repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;

Parameter
NameDescription
indexint
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.FileOrBuilder

getFileOrBuilderList()

public List<? extends PluginProtos.CodeGeneratorResponse.FileOrBuilder> getFileOrBuilderList()

repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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.

Returns
TypeDescription
GeneratedMessageV3.FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()

Returns true if all required fields in the message and all embedded messages are set, false otherwise.

See also: MessageOrBuilder#getInitializationErrorString()

Returns
TypeDescription
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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.

Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder
Overrides
Exceptions
TypeDescription
IOException

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
NameDescription
otherMessage
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder
Overrides

mergeFrom(PluginProtos.CodeGeneratorResponse other)

public PluginProtos.CodeGeneratorResponse.Builder mergeFrom(PluginProtos.CodeGeneratorResponse other)
Parameter
NameDescription
otherPluginProtos.CodeGeneratorResponse
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final PluginProtos.CodeGeneratorResponse.Builder mergeUnknownFields(UnknownFieldSet unknownFields)

Merge some unknown fields into the UnknownFieldSet for this message.

Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder
Overrides

removeFile(int index)

public PluginProtos.CodeGeneratorResponse.Builder removeFile(int index)

repeated .google.protobuf.compiler.CodeGeneratorResponse.File file = 15;

Parameter
NameDescription
indexint
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder

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
NameDescription
valueString

The error to set.

Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder

This builder for chaining.

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
NameDescription
valueByteString

The bytes for error to set.

Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public PluginProtos.CodeGeneratorResponse.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldDescriptors.FieldDescriptor
valueObject
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder
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;

Parameters
NameDescription
indexint
valuePluginProtos.CodeGeneratorResponse.File
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder

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;

Parameters
NameDescription
indexint
builderForValuePluginProtos.CodeGeneratorResponse.File.Builder
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public PluginProtos.CodeGeneratorResponse.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldDescriptors.FieldDescriptor
indexint
valueObject
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder
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
NameDescription
valuelong

The supportedFeatures to set.

Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final PluginProtos.CodeGeneratorResponse.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
PluginProtos.CodeGeneratorResponse.Builder
Overrides