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
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > DescriptorProtos.GeneratedCodeInfo.Annotation.BuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
values |
Iterable<? extends java.lang.Integer> The path to add. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
value |
int The path to add. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
field |
Descriptors.FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder |
build()
public DescriptorProtos.GeneratedCodeInfo.Annotation build()
Returns | |
---|---|
Type | Description |
DescriptorProtos.GeneratedCodeInfo.Annotation |
buildPartial()
public DescriptorProtos.GeneratedCodeInfo.Annotation buildPartial()
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder |
This builder for chaining. |
clearField(Descriptors.FieldDescriptor field)
public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder clearField(Descriptors.FieldDescriptor field)
Parameter | |
---|---|
Name | Description |
field |
Descriptors.FieldDescriptor |
Returns | |
---|---|
Type | Description |
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder |
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 | |
---|---|
Name | Description |
oneof |
Descriptors.OneofDescriptor |
Returns | |
---|---|
Type | Description |
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder |
This builder for chaining. |
clone()
public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder clone()
Clones the Builder.
Returns | |
---|---|
Type | Description |
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
Descriptors.Descriptor |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
index |
int The index of the element to return. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
String |
The sourceFile. |
getSourceFileBytes()
public ByteString getSourceFileBytes()
Identifies the filesystem path to the original source .proto.
optional string source_file = 2;
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
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 | |
---|---|
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 |
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 | |
---|---|
Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
Returns | |
---|---|
Type | Description |
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder |
Exceptions | |
---|---|
Type | Description |
IOException |
mergeFrom(DescriptorProtos.GeneratedCodeInfo.Annotation other)
public DescriptorProtos.GeneratedCodeInfo.Annotation.Builder mergeFrom(DescriptorProtos.GeneratedCodeInfo.Annotation other)
Parameter | |
---|---|
Name | Description |
other |
DescriptorProtos.GeneratedCodeInfo.Annotation |
Returns | |
---|---|
Type | Description |
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
, 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 |
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final DescriptorProtos.GeneratedCodeInfo.Annotation.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Merge some unknown fields into the UnknownFieldSet for this message.
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder |
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 | |
---|---|
Name | Description |
value |
int The begin to set. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
value |
int The end to set. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
field |
Descriptors.FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder |
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 | |
---|---|
Name | Description |
index |
int The index to set the value at. |
value |
int The path to set. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
field |
Descriptors.FieldDescriptor |
index |
int |
value |
Object |
Returns | |
---|---|
Type | Description |
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder |
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 | |
---|---|
Name | Description |
value |
String The sourceFile to set. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
value |
ByteString The bytes for sourceFile to set. |
Returns | |
---|---|
Type | Description |
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder |
This builder for chaining. |
setUnknownFields(UnknownFieldSet unknownFields)
public final DescriptorProtos.GeneratedCodeInfo.Annotation.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
DescriptorProtos.GeneratedCodeInfo.Annotation.Builder |