Class DescriptorProtos.FileDescriptorProto (3.19.4)

public static final class DescriptorProtos.FileDescriptorProto extends GeneratedMessageV3 implements DescriptorProtos.FileDescriptorProtoOrBuilder

Describes a complete .proto file.

Protobuf type google.protobuf.FileDescriptorProto

Inheritance

Object > AbstractMessageLite<MessageType,BuilderType> > AbstractMessage > GeneratedMessageV3 > DescriptorProtos.FileDescriptorProto

Static Fields

DEPENDENCY_FIELD_NUMBER

public static final int DEPENDENCY_FIELD_NUMBER
Field Value
TypeDescription
int

ENUM_TYPE_FIELD_NUMBER

public static final int ENUM_TYPE_FIELD_NUMBER
Field Value
TypeDescription
int

EXTENSION_FIELD_NUMBER

public static final int EXTENSION_FIELD_NUMBER
Field Value
TypeDescription
int

MESSAGE_TYPE_FIELD_NUMBER

public static final int MESSAGE_TYPE_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

OPTIONS_FIELD_NUMBER

public static final int OPTIONS_FIELD_NUMBER
Field Value
TypeDescription
int

PACKAGE_FIELD_NUMBER

public static final int PACKAGE_FIELD_NUMBER
Field Value
TypeDescription
int

PARSER

public static final Parser<DescriptorProtos.FileDescriptorProto> PARSER
Field Value
TypeDescription
Parser<FileDescriptorProto>

PUBLIC_DEPENDENCY_FIELD_NUMBER

public static final int PUBLIC_DEPENDENCY_FIELD_NUMBER
Field Value
TypeDescription
int

SERVICE_FIELD_NUMBER

public static final int SERVICE_FIELD_NUMBER
Field Value
TypeDescription
int

SOURCE_CODE_INFO_FIELD_NUMBER

public static final int SOURCE_CODE_INFO_FIELD_NUMBER
Field Value
TypeDescription
int

SYNTAX_FIELD_NUMBER

public static final int SYNTAX_FIELD_NUMBER
Field Value
TypeDescription
int

WEAK_DEPENDENCY_FIELD_NUMBER

public static final int WEAK_DEPENDENCY_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static DescriptorProtos.FileDescriptorProto getDefaultInstance()
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto

getDescriptor()

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

newBuilder()

public static DescriptorProtos.FileDescriptorProto.Builder newBuilder()
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto.Builder

newBuilder(DescriptorProtos.FileDescriptorProto prototype)

public static DescriptorProtos.FileDescriptorProto.Builder newBuilder(DescriptorProtos.FileDescriptorProto prototype)
Parameter
NameDescription
prototypeDescriptorProtos.FileDescriptorProto
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto.Builder

parseDelimitedFrom(InputStream input)

public static DescriptorProtos.FileDescriptorProto parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.FileDescriptorProto parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static DescriptorProtos.FileDescriptorProto parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.FileDescriptorProto parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static DescriptorProtos.FileDescriptorProto parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.FileDescriptorProto parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static DescriptorProtos.FileDescriptorProto parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.FileDescriptorProto parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static DescriptorProtos.FileDescriptorProto parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.FileDescriptorProto parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static DescriptorProtos.FileDescriptorProto parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static DescriptorProtos.FileDescriptorProto parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<DescriptorProtos.FileDescriptorProto> parser()
Returns
TypeDescription
Parser<FileDescriptorProto>

Methods

equals(Object obj)

public boolean equals(Object obj)

Compares the specified object with this message for equality. Returns true if the given object is a message of the same type (as defined by getDescriptorForType()) and has identical values for all of its fields. Subclasses must implement this; inheriting Object.equals() is incorrect.

Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

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

getDependency(int index)

public String getDependency(int index)

Names of files imported by this file.

repeated string dependency = 3;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
String

The dependency at the given index.

getDependencyBytes(int index)

public ByteString getDependencyBytes(int index)

Names of files imported by this file.

repeated string dependency = 3;

Parameter
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
ByteString

The bytes of the dependency at the given index.

getDependencyCount()

public int getDependencyCount()

Names of files imported by this file.

repeated string dependency = 3;

Returns
TypeDescription
int

The count of dependency.

getDependencyList()

public ProtocolStringList getDependencyList()

Names of files imported by this file.

repeated string dependency = 3;

Returns
TypeDescription
ProtocolStringList

A list containing the dependency.

getEnumType(int index)

public DescriptorProtos.EnumDescriptorProto getEnumType(int index)

repeated .google.protobuf.EnumDescriptorProto enum_type = 5;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.EnumDescriptorProto

getEnumTypeCount()

public int getEnumTypeCount()

repeated .google.protobuf.EnumDescriptorProto enum_type = 5;

Returns
TypeDescription
int

getEnumTypeList()

public List<DescriptorProtos.EnumDescriptorProto> getEnumTypeList()

repeated .google.protobuf.EnumDescriptorProto enum_type = 5;

Returns
TypeDescription
List<EnumDescriptorProto>

getEnumTypeOrBuilder(int index)

public DescriptorProtos.EnumDescriptorProtoOrBuilder getEnumTypeOrBuilder(int index)

repeated .google.protobuf.EnumDescriptorProto enum_type = 5;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.EnumDescriptorProtoOrBuilder

getEnumTypeOrBuilderList()

public List<? extends DescriptorProtos.EnumDescriptorProtoOrBuilder> getEnumTypeOrBuilderList()

repeated .google.protobuf.EnumDescriptorProto enum_type = 5;

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

getExtension(int index)

public DescriptorProtos.FieldDescriptorProto getExtension(int index)

repeated .google.protobuf.FieldDescriptorProto extension = 7;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.FieldDescriptorProto

getExtensionCount()

public int getExtensionCount()

repeated .google.protobuf.FieldDescriptorProto extension = 7;

Returns
TypeDescription
int

getExtensionList()

public List<DescriptorProtos.FieldDescriptorProto> getExtensionList()

repeated .google.protobuf.FieldDescriptorProto extension = 7;

Returns
TypeDescription
List<FieldDescriptorProto>

getExtensionOrBuilder(int index)

public DescriptorProtos.FieldDescriptorProtoOrBuilder getExtensionOrBuilder(int index)

repeated .google.protobuf.FieldDescriptorProto extension = 7;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.FieldDescriptorProtoOrBuilder

getExtensionOrBuilderList()

public List<? extends DescriptorProtos.FieldDescriptorProtoOrBuilder> getExtensionOrBuilderList()

repeated .google.protobuf.FieldDescriptorProto extension = 7;

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

getMessageType(int index)

public DescriptorProtos.DescriptorProto getMessageType(int index)

All top-level definitions in this file.

repeated .google.protobuf.DescriptorProto message_type = 4;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.DescriptorProto

getMessageTypeCount()

public int getMessageTypeCount()

All top-level definitions in this file.

repeated .google.protobuf.DescriptorProto message_type = 4;

Returns
TypeDescription
int

getMessageTypeList()

public List<DescriptorProtos.DescriptorProto> getMessageTypeList()

All top-level definitions in this file.

repeated .google.protobuf.DescriptorProto message_type = 4;

Returns
TypeDescription
List<DescriptorProto>

getMessageTypeOrBuilder(int index)

public DescriptorProtos.DescriptorProtoOrBuilder getMessageTypeOrBuilder(int index)

All top-level definitions in this file.

repeated .google.protobuf.DescriptorProto message_type = 4;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.DescriptorProtoOrBuilder

getMessageTypeOrBuilderList()

public List<? extends DescriptorProtos.DescriptorProtoOrBuilder> getMessageTypeOrBuilderList()

All top-level definitions in this file.

repeated .google.protobuf.DescriptorProto message_type = 4;

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

getName()

public String getName()

file name, relative to root of source tree

optional string name = 1;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

file name, relative to root of source tree

optional string name = 1;

Returns
TypeDescription
ByteString

The bytes for name.

getOptions()

public DescriptorProtos.FileOptions getOptions()

optional .google.protobuf.FileOptions options = 8;

Returns
TypeDescription
DescriptorProtos.FileOptions

The options.

getOptionsOrBuilder()

public DescriptorProtos.FileOptionsOrBuilder getOptionsOrBuilder()

optional .google.protobuf.FileOptions options = 8;

Returns
TypeDescription
DescriptorProtos.FileOptionsOrBuilder

getPackage()

public String getPackage()

e.g. "foo", "foo.bar", etc.

optional string package = 2;

Returns
TypeDescription
String

The package.

getPackageBytes()

public ByteString getPackageBytes()

e.g. "foo", "foo.bar", etc.

optional string package = 2;

Returns
TypeDescription
ByteString

The bytes for package.

getParserForType()

public Parser<DescriptorProtos.FileDescriptorProto> getParserForType()
Returns
TypeDescription
Parser<FileDescriptorProto>
Overrides

getPublicDependency(int index)

public int getPublicDependency(int index)

Indexes of the public imported files in the dependency list above.

repeated int32 public_dependency = 10;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
int

The publicDependency at the given index.

getPublicDependencyCount()

public int getPublicDependencyCount()

Indexes of the public imported files in the dependency list above.

repeated int32 public_dependency = 10;

Returns
TypeDescription
int

The count of publicDependency.

getPublicDependencyList()

public List<Integer> getPublicDependencyList()

Indexes of the public imported files in the dependency list above.

repeated int32 public_dependency = 10;

Returns
TypeDescription
List<Integer>

A list containing the publicDependency.

getSerializedSize()

public int getSerializedSize()

Get the number of bytes required to encode this message. The result is only computed on the first call and memoized after that.

If this message requires more than Integer.MAX_VALUE bytes to encode, the return value will be smaller than the actual number of bytes required and might be negative.

Returns
TypeDescription
int
Overrides

getService(int index)

public DescriptorProtos.ServiceDescriptorProto getService(int index)

repeated .google.protobuf.ServiceDescriptorProto service = 6;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.ServiceDescriptorProto

getServiceCount()

public int getServiceCount()

repeated .google.protobuf.ServiceDescriptorProto service = 6;

Returns
TypeDescription
int

getServiceList()

public List<DescriptorProtos.ServiceDescriptorProto> getServiceList()

repeated .google.protobuf.ServiceDescriptorProto service = 6;

Returns
TypeDescription
List<ServiceDescriptorProto>

getServiceOrBuilder(int index)

public DescriptorProtos.ServiceDescriptorProtoOrBuilder getServiceOrBuilder(int index)

repeated .google.protobuf.ServiceDescriptorProto service = 6;

Parameter
NameDescription
indexint
Returns
TypeDescription
DescriptorProtos.ServiceDescriptorProtoOrBuilder

getServiceOrBuilderList()

public List<? extends DescriptorProtos.ServiceDescriptorProtoOrBuilder> getServiceOrBuilderList()

repeated .google.protobuf.ServiceDescriptorProto service = 6;

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

getSourceCodeInfo()

public DescriptorProtos.SourceCodeInfo getSourceCodeInfo()

This field contains optional information about the original source code. You may safely remove this entire field without harming runtime functionality of the descriptors -- the information is needed only by development tools.

optional .google.protobuf.SourceCodeInfo source_code_info = 9;

Returns
TypeDescription
DescriptorProtos.SourceCodeInfo

The sourceCodeInfo.

getSourceCodeInfoOrBuilder()

public DescriptorProtos.SourceCodeInfoOrBuilder getSourceCodeInfoOrBuilder()

This field contains optional information about the original source code. You may safely remove this entire field without harming runtime functionality of the descriptors -- the information is needed only by development tools.

optional .google.protobuf.SourceCodeInfo source_code_info = 9;

Returns
TypeDescription
DescriptorProtos.SourceCodeInfoOrBuilder

getSyntax()

public String getSyntax()

The syntax of the proto file. The supported values are "proto2" and "proto3".

optional string syntax = 12;

Returns
TypeDescription
String

The syntax.

getSyntaxBytes()

public ByteString getSyntaxBytes()

The syntax of the proto file. The supported values are "proto2" and "proto3".

optional string syntax = 12;

Returns
TypeDescription
ByteString

The bytes for syntax.

getUnknownFields()

public final UnknownFieldSet getUnknownFields()

Get the UnknownFieldSet for this message.

Returns
TypeDescription
UnknownFieldSet
Overrides

getWeakDependency(int index)

public int getWeakDependency(int index)

Indexes of the weak imported files in the dependency list. For Google-internal migration only. Do not use.

repeated int32 weak_dependency = 11;

Parameter
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
int

The weakDependency at the given index.

getWeakDependencyCount()

public int getWeakDependencyCount()

Indexes of the weak imported files in the dependency list. For Google-internal migration only. Do not use.

repeated int32 weak_dependency = 11;

Returns
TypeDescription
int

The count of weakDependency.

getWeakDependencyList()

public List<Integer> getWeakDependencyList()

Indexes of the weak imported files in the dependency list. For Google-internal migration only. Do not use.

repeated int32 weak_dependency = 11;

Returns
TypeDescription
List<Integer>

A list containing the weakDependency.

hasName()

public boolean hasName()

file name, relative to root of source tree

optional string name = 1;

Returns
TypeDescription
boolean

Whether the name field is set.

hasOptions()

public boolean hasOptions()

optional .google.protobuf.FileOptions options = 8;

Returns
TypeDescription
boolean

Whether the options field is set.

hasPackage()

public boolean hasPackage()

e.g. "foo", "foo.bar", etc.

optional string package = 2;

Returns
TypeDescription
boolean

Whether the package field is set.

hasSourceCodeInfo()

public boolean hasSourceCodeInfo()

This field contains optional information about the original source code. You may safely remove this entire field without harming runtime functionality of the descriptors -- the information is needed only by development tools.

optional .google.protobuf.SourceCodeInfo source_code_info = 9;

Returns
TypeDescription
boolean

Whether the sourceCodeInfo field is set.

hasSyntax()

public boolean hasSyntax()

The syntax of the proto file. The supported values are "proto2" and "proto3".

optional string syntax = 12;

Returns
TypeDescription
boolean

Whether the syntax field is set.

hashCode()

public int hashCode()

Returns the hash code value for this message. The hash code of a message should mix the message's type (object identity of the descriptor) with its contents (known and unknown field values). Subclasses must implement this; inheriting Object.hashCode() is incorrect.

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

newBuilderForType()

public DescriptorProtos.FileDescriptorProto.Builder newBuilderForType()
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected DescriptorProtos.FileDescriptorProto.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)

TODO(xiaofeng): remove this together with GeneratedMessageV3.BuilderParent.

Parameter
NameDescription
parentGeneratedMessageV3.BuilderParent
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

Creates a new instance of this message type. Overridden in the generated code.

Parameter
NameDescription
unusedGeneratedMessageV3.UnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public DescriptorProtos.FileDescriptorProto.Builder toBuilder()
Returns
TypeDescription
DescriptorProtos.FileDescriptorProto.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)

Serializes the message and writes it to output. This does not flush or close the stream.

Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException