Class DescriptorProtos.FileDescriptorSet.Builder

public static final class DescriptorProtos.FileDescriptorSet.Builder extends GeneratedMessageV3.Builder<DescriptorProtos.FileDescriptorSet.Builder> implements DescriptorProtos.FileDescriptorSetOrBuilder


The protocol compiler can output a FileDescriptorSet containing the .proto
files it parses.

Protobuf type google.protobuf.FileDescriptorSet

Methods

addAllFile(Iterable<? extends DescriptorProtos.FileDescriptorProto> values)

public DescriptorProtos.FileDescriptorSet.Builder addAllFile(Iterable<? extends DescriptorProtos.FileDescriptorProto> values)

repeated .google.protobuf.FileDescriptorProto file = 1;

Parameter
NameDescription
valuesIterable<? extends com.google.protobuf.DescriptorProtos.FileDescriptorProto>
Returns
TypeDescription
DescriptorProtos.FileDescriptorSet.Builder

addFile(DescriptorProtos.FileDescriptorProto value)

public DescriptorProtos.FileDescriptorSet.Builder addFile(DescriptorProtos.FileDescriptorProto value)

repeated .google.protobuf.FileDescriptorProto file = 1;

Parameter
NameDescription
valueDescriptorProtos.FileDescriptorProto
Returns
TypeDescription
DescriptorProtos.FileDescriptorSet.Builder

addFile(DescriptorProtos.FileDescriptorProto.Builder builderForValue)

public DescriptorProtos.FileDescriptorSet.Builder addFile(DescriptorProtos.FileDescriptorProto.Builder builderForValue)

repeated .google.protobuf.FileDescriptorProto file = 1;

Parameter
NameDescription
builderForValueDescriptorProtos.FileDescriptorProto.Builder
Returns
TypeDescription
DescriptorProtos.FileDescriptorSet.Builder

addFile(int index, DescriptorProtos.FileDescriptorProto value)

public DescriptorProtos.FileDescriptorSet.Builder addFile(int index, DescriptorProtos.FileDescriptorProto value)

repeated .google.protobuf.FileDescriptorProto file = 1;

Parameters
NameDescription
indexint
valueDescriptorProtos.FileDescriptorProto
Returns
TypeDescription
DescriptorProtos.FileDescriptorSet.Builder

addFile(int index, DescriptorProtos.FileDescriptorProto.Builder builderForValue)

public DescriptorProtos.FileDescriptorSet.Builder addFile(int index, DescriptorProtos.FileDescriptorProto.Builder builderForValue)

repeated .google.protobuf.FileDescriptorProto file = 1;

Parameters
NameDescription
indexint
builderForValueDescriptorProtos.FileDescriptorProto.Builder
Returns
TypeDescription
DescriptorProtos.FileDescriptorSet.Builder

addFileBuilder()

public DescriptorProtos.FileDescriptorProto.Builder addFileBuilder()

repeated .google.protobuf.FileDescriptorProto file = 1;

Returns
TypeDescription
DescriptorProtos.FileDescriptorProto.Builder

addFileBuilder(int index)

public DescriptorProtos.FileDescriptorProto.Builder addFileBuilder(int index)

repeated .google.protobuf.FileDescriptorProto file = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

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

buildPartial()

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

clear()

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

clearField(Descriptors.FieldDescriptor field)

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

clearFile()

public DescriptorProtos.FileDescriptorSet.Builder clearFile()

repeated .google.protobuf.FileDescriptorProto file = 1;

Returns
TypeDescription
DescriptorProtos.FileDescriptorSet.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

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

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

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

clone()

public DescriptorProtos.FileDescriptorSet.Builder clone()

Clones the Builder.

Returns
TypeDescription
DescriptorProtos.FileDescriptorSet.Builder
Overrides

getDefaultInstanceForType()

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

getDescriptor()

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

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

getFile(int index)

public DescriptorProtos.FileDescriptorProto getFile(int index)

repeated .google.protobuf.FileDescriptorProto file = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto

getFileBuilder(int index)

public DescriptorProtos.FileDescriptorProto.Builder getFileBuilder(int index)

repeated .google.protobuf.FileDescriptorProto file = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto.Builder

getFileBuilderList()

public List<DescriptorProtos.FileDescriptorProto.Builder> getFileBuilderList()

repeated .google.protobuf.FileDescriptorProto file = 1;

Returns
TypeDescription
List<Builder>

getFileCount()

public int getFileCount()

repeated .google.protobuf.FileDescriptorProto file = 1;

Returns
TypeDescription
int

getFileList()

public List<DescriptorProtos.FileDescriptorProto> getFileList()

repeated .google.protobuf.FileDescriptorProto file = 1;

Returns
TypeDescription
List<FileDescriptorProto>

getFileOrBuilder(int index)

public DescriptorProtos.FileDescriptorProtoOrBuilder getFileOrBuilder(int index)

repeated .google.protobuf.FileDescriptorProto file = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.FileDescriptorProtoOrBuilder

getFileOrBuilderList()

public List<? extends DescriptorProtos.FileDescriptorProtoOrBuilder> getFileOrBuilderList()

repeated .google.protobuf.FileDescriptorProto file = 1;

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

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

mergeFrom(DescriptorProtos.FileDescriptorSet other)

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

mergeFrom(Message other)

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

mergeUnknownFields(UnknownFieldSet unknownFields)

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

Merge some unknown fields into the UnknownFieldSet for this message.

Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
DescriptorProtos.FileDescriptorSet.Builder
Overrides

removeFile(int index)

public DescriptorProtos.FileDescriptorSet.Builder removeFile(int index)

repeated .google.protobuf.FileDescriptorProto file = 1;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.FileDescriptorSet.Builder

setField(Descriptors.FieldDescriptor field, Object value)

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

setFile(int index, DescriptorProtos.FileDescriptorProto value)

public DescriptorProtos.FileDescriptorSet.Builder setFile(int index, DescriptorProtos.FileDescriptorProto value)

repeated .google.protobuf.FileDescriptorProto file = 1;

Parameters
NameDescription
indexint
valueDescriptorProtos.FileDescriptorProto
Returns
TypeDescription
DescriptorProtos.FileDescriptorSet.Builder

setFile(int index, DescriptorProtos.FileDescriptorProto.Builder builderForValue)

public DescriptorProtos.FileDescriptorSet.Builder setFile(int index, DescriptorProtos.FileDescriptorProto.Builder builderForValue)

repeated .google.protobuf.FileDescriptorProto file = 1;

Parameters
NameDescription
indexint
builderForValueDescriptorProtos.FileDescriptorProto.Builder
Returns
TypeDescription
DescriptorProtos.FileDescriptorSet.Builder

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

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

setUnknownFields(UnknownFieldSet unknownFields)

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