Class DescriptorProtos.GeneratedCodeInfo.Annotation.Builder (3.19.4)

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

Protobuf type google.protobuf.GeneratedCodeInfo.Annotation

Static Methods

getDescriptor()

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

Methods

addAllPath(Iterable<? extends Integer> values)

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

Identifies the element in the original source .proto file. This field is formatted the same as SourceCodeInfo.Location.path.

repeated int32 path = 1 [packed = true];

Parameter
NameDescription
valuesIterable<? extends java.lang.Integer>

The path to add.

Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder

This builder for chaining.

addPath(int value)

public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder addPath(int value)

Identifies the element in the original source .proto file. This field is formatted the same as SourceCodeInfo.Location.path.

repeated int32 path = 1 [packed = true];

Parameter
NameDescription
valueint

The path to add.

Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

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

buildPartial()

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

clear()

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

clearBegin()

public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder clearBegin()

Identifies the starting offset in bytes in the generated code that relates to the identified object.

optional int32 begin = 3;

Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder

This builder for chaining.

clearEnd()

public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder clearEnd()

Identifies the ending offset in bytes in the generated code that relates to the identified offset. The end offset should be one past the last relevant byte (so the length of the text = end - begin).

optional int32 end = 4;

Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

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

clearOneof(Descriptors.OneofDescriptor oneof)

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

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

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

clearPath()

public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder clearPath()

Identifies the element in the original source .proto file. This field is formatted the same as SourceCodeInfo.Location.path.

repeated int32 path = 1 [packed = true];

Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder

This builder for chaining.

clearSourceFile()

public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder clearSourceFile()

Identifies the filesystem path to the original source .proto.

optional string source_file = 2;

Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder

This builder for chaining.

clone()

public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder clone()

Clones the Builder.

Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder
Overrides

getBegin()

public int getBegin()

Identifies the starting offset in bytes in the generated code that relates to the identified object.

optional int32 begin = 3;

Returns
TypeDescription
int

The begin.

getDefaultInstanceForType()

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

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

getEnd()

public int getEnd()

Identifies the ending offset in bytes in the generated code that relates to the identified offset. The end offset should be one past the last relevant byte (so the length of the text = end - begin).

optional int32 end = 4;

Returns
TypeDescription
int

The end.

getPath(int index)

public int getPath(int index)

Identifies the element in the original source .proto file. This field is formatted the same as SourceCodeInfo.Location.path.

repeated int32 path = 1 [packed = true];

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
int

The path at the given index.

getPathCount()

public int getPathCount()

Identifies the element in the original source .proto file. This field is formatted the same as SourceCodeInfo.Location.path.

repeated int32 path = 1 [packed = true];

Returns
TypeDescription
int

The count of path.

getPathList()

public List<Integer> getPathList()

Identifies the element in the original source .proto file. This field is formatted the same as SourceCodeInfo.Location.path.

repeated int32 path = 1 [packed = true];

Returns
TypeDescription
List<Integer>

A list containing the path.

getSourceFile()

public String getSourceFile()

Identifies the filesystem path to the original source .proto.

optional string source_file = 2;

Returns
TypeDescription
String

The sourceFile.

getSourceFileBytes()

public ByteString getSourceFileBytes()

Identifies the filesystem path to the original source .proto.

optional string source_file = 2;

Returns
TypeDescription
ByteString

The bytes for sourceFile.

hasBegin()

public boolean hasBegin()

Identifies the starting offset in bytes in the generated code that relates to the identified object.

optional int32 begin = 3;

Returns
TypeDescription
boolean

Whether the begin field is set.

hasEnd()

public boolean hasEnd()

Identifies the ending offset in bytes in the generated code that relates to the identified offset. The end offset should be one past the last relevant byte (so the length of the text = end - begin).

optional int32 end = 4;

Returns
TypeDescription
boolean

Whether the end field is set.

hasSourceFile()

public boolean hasSourceFile()

Identifies the filesystem path to the original source .proto.

optional string source_file = 2;

Returns
TypeDescription
boolean

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

mergeFrom(DescriptorProtos.GeneratedCodeInfo.Annotation other)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

Merge some unknown fields into the UnknownFieldSet for this message.

Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder
Overrides

setBegin(int value)

public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder setBegin(int value)

Identifies the starting offset in bytes in the generated code that relates to the identified object.

optional int32 begin = 3;

Parameter
NameDescription
valueint

The begin to set.

Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder

This builder for chaining.

setEnd(int value)

public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder setEnd(int value)

Identifies the ending offset in bytes in the generated code that relates to the identified offset. The end offset should be one past the last relevant byte (so the length of the text = end - begin).

optional int32 end = 4;

Parameter
NameDescription
valueint

The end to set.

Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setPath(int index, int value)

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

Identifies the element in the original source .proto file. This field is formatted the same as SourceCodeInfo.Location.path.

repeated int32 path = 1 [packed = true];

Parameters
NameDescription
indexint

The index to set the value at.

valueint

The path to set.

Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder

This builder for chaining.

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

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

setSourceFile(String value)

public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder setSourceFile(String value)

Identifies the filesystem path to the original source .proto.

optional string source_file = 2;

Parameter
NameDescription
valueString

The sourceFile to set.

Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder

This builder for chaining.

setSourceFileBytes(ByteString value)

public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder setSourceFileBytes(ByteString value)

Identifies the filesystem path to the original source .proto.

optional string source_file = 2;

Parameter
NameDescription
valueByteString

The bytes for sourceFile to set.

Returns
TypeDescription
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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