Class DescriptorProtos.GeneratedCodeInfo.Builder (3.19.4)

public static final class DescriptorProtos.GeneratedCodeInfo.Builder extends GeneratedMessageV3.Builder<DescriptorProtos.GeneratedCodeInfo.Builder> implements DescriptorProtos.GeneratedCodeInfoOrBuilder

Describes the relationship between generated code and its original source file. A GeneratedCodeInfo message is associated with only one generated source file, but may contain references to different source .proto files.

Protobuf type google.protobuf.GeneratedCodeInfo

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptors.Descriptor

Methods

addAllAnnotation(Iterable<? extends DescriptorProtos.GeneratedCodeInfo.Annotation> values)

public DescriptorProtos.GeneratedCodeInfo.Builder addAllAnnotation(Iterable<? extends DescriptorProtos.GeneratedCodeInfo.Annotation> values)

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Parameter
NameDescription
valuesIterable<? extends com.google.protobuf.DescriptorProtos.GeneratedCodeInfo.Annotation>
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder

addAnnotation(DescriptorProtos.GeneratedCodeInfo.Annotation value)

public DescriptorProtos.GeneratedCodeInfo.Builder addAnnotation(DescriptorProtos.GeneratedCodeInfo.Annotation value)

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Parameter
NameDescription
valueDescriptorProtos.GeneratedCodeInfo.Annotation
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder

addAnnotation(DescriptorProtos.GeneratedCodeInfo.Annotation.Builder builderForValue)

public DescriptorProtos.GeneratedCodeInfo.Builder addAnnotation(DescriptorProtos.GeneratedCodeInfo.Annotation.Builder builderForValue)

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Parameter
NameDescription
builderForValueDescriptorProtos.GeneratedCodeInfo.Annotation.Builder
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder

addAnnotation(int index, DescriptorProtos.GeneratedCodeInfo.Annotation value)

public DescriptorProtos.GeneratedCodeInfo.Builder addAnnotation(int index, DescriptorProtos.GeneratedCodeInfo.Annotation value)

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Parameters
NameDescription
indexint
valueDescriptorProtos.GeneratedCodeInfo.Annotation
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder

addAnnotation(int index, DescriptorProtos.GeneratedCodeInfo.Annotation.Builder builderForValue)

public DescriptorProtos.GeneratedCodeInfo.Builder addAnnotation(int index, DescriptorProtos.GeneratedCodeInfo.Annotation.Builder builderForValue)

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Parameters
NameDescription
indexint
builderForValueDescriptorProtos.GeneratedCodeInfo.Annotation.Builder
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder

addAnnotationBuilder()

public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder addAnnotationBuilder()

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder

addAnnotationBuilder(int index)

public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder addAnnotationBuilder(int index)

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public DescriptorProtos.GeneratedCodeInfo build()
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo

buildPartial()

public DescriptorProtos.GeneratedCodeInfo buildPartial()
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo

clear()

public DescriptorProtos.GeneratedCodeInfo.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
DescriptorProtos.GeneratedCodeInfo.Builder
Overrides

clearAnnotation()

public DescriptorProtos.GeneratedCodeInfo.Builder clearAnnotation()

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder

clearField(Descriptors.FieldDescriptor field)

public DescriptorProtos.GeneratedCodeInfo.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldDescriptors.FieldDescriptor
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder
Overrides

clearOneof(Descriptors.OneofDescriptor oneof)

public DescriptorProtos.GeneratedCodeInfo.Builder clearOneof(Descriptors.OneofDescriptor oneof)

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

Parameter
NameDescription
oneofDescriptors.OneofDescriptor
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder
Overrides

clone()

public DescriptorProtos.GeneratedCodeInfo.Builder clone()

Clones the Builder.

Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder
Overrides

getAnnotation(int index)

public DescriptorProtos.GeneratedCodeInfo.Annotation getAnnotation(int index)

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation

getAnnotationBuilder(int index)

public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder getAnnotationBuilder(int index)

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder

getAnnotationBuilderList()

public List<DescriptorProtos.GeneratedCodeInfo.Annotation.Builder> getAnnotationBuilderList()

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Returns
TypeDescription
List<Builder>

getAnnotationCount()

public int getAnnotationCount()

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Returns
TypeDescription
int

getAnnotationList()

public List<DescriptorProtos.GeneratedCodeInfo.Annotation> getAnnotationList()

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Returns
TypeDescription
List<Annotation>

getAnnotationOrBuilder(int index)

public DescriptorProtos.GeneratedCodeInfo.AnnotationOrBuilder getAnnotationOrBuilder(int index)

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.AnnotationOrBuilder

getAnnotationOrBuilderList()

public List<? extends DescriptorProtos.GeneratedCodeInfo.AnnotationOrBuilder> getAnnotationOrBuilderList()

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Returns
TypeDescription
List<? extends com.google.protobuf.DescriptorProtos.GeneratedCodeInfo.AnnotationOrBuilder>

getDefaultInstanceForType()

public DescriptorProtos.GeneratedCodeInfo 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
DescriptorProtos.GeneratedCodeInfo

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

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 DescriptorProtos.GeneratedCodeInfo.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
DescriptorProtos.GeneratedCodeInfo.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(DescriptorProtos.GeneratedCodeInfo other)

public DescriptorProtos.GeneratedCodeInfo.Builder mergeFrom(DescriptorProtos.GeneratedCodeInfo other)
Parameter
NameDescription
otherDescriptorProtos.GeneratedCodeInfo
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder

mergeFrom(Message other)

public DescriptorProtos.GeneratedCodeInfo.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
DescriptorProtos.GeneratedCodeInfo.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final DescriptorProtos.GeneratedCodeInfo.Builder mergeUnknownFields(UnknownFieldSet unknownFields)

Merge some unknown fields into the UnknownFieldSet for this message.

Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder
Overrides

removeAnnotation(int index)

public DescriptorProtos.GeneratedCodeInfo.Builder removeAnnotation(int index)

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder

setAnnotation(int index, DescriptorProtos.GeneratedCodeInfo.Annotation value)

public DescriptorProtos.GeneratedCodeInfo.Builder setAnnotation(int index, DescriptorProtos.GeneratedCodeInfo.Annotation value)

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Parameters
NameDescription
indexint
valueDescriptorProtos.GeneratedCodeInfo.Annotation
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder

setAnnotation(int index, DescriptorProtos.GeneratedCodeInfo.Annotation.Builder builderForValue)

public DescriptorProtos.GeneratedCodeInfo.Builder setAnnotation(int index, DescriptorProtos.GeneratedCodeInfo.Annotation.Builder builderForValue)

An Annotation connects some span of text in generated code to an element of its generating .proto file.

repeated .google.protobuf.GeneratedCodeInfo.Annotation annotation = 1;

Parameters
NameDescription
indexint
builderForValueDescriptorProtos.GeneratedCodeInfo.Annotation.Builder
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public DescriptorProtos.GeneratedCodeInfo.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldDescriptors.FieldDescriptor
valueObject
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder
Overrides

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

public DescriptorProtos.GeneratedCodeInfo.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldDescriptors.FieldDescriptor
indexint
valueObject
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final DescriptorProtos.GeneratedCodeInfo.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Builder
Overrides