public static final class DescriptorProtos.FieldDescriptorProto extends GeneratedMessageimplements DescriptorProtos .FieldDescriptorProtoOrBuilder
google.protobuf.FieldDescriptorProto
Describes a field within a message.
| Modifier and Type | Class and Description |
|---|---|
static class |
DescriptorProtos
Protobuf type
google.protobuf.FieldDescriptorProto
|
static class |
DescriptorProtos
Protobuf enum
google.protobuf.FieldDescriptorProto.Label
|
static class |
DescriptorProtos
Protobuf enum
google.protobuf.FieldDescriptorProto.Type
|
GeneratedMessage.BuilderParent , GeneratedMessage.ExtendableBuilder <MessageType extends GeneratedMessage.ExtendableMessage ,BuilderType extends GeneratedMessage.ExtendableBuilder >, GeneratedMessage.ExtendableMessage <MessageType extends GeneratedMessage.ExtendableMessage >, GeneratedMessage.ExtendableMessageOrBuilder <MessageType extends GeneratedMessage.ExtendableMessage >, GeneratedMessage.FieldAccessorTable , GeneratedMessage.GeneratedExtension <ContainingType extends Message,Type> | Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_VALUE_FIELD_NUMBER
|
static int |
EXTENDEE_FIELD_NUMBER
|
static int |
LABEL_FIELD_NUMBER
|
static int |
NAME_FIELD_NUMBER
|
static int |
NUMBER_FIELD_NUMBER
|
static int |
ONEOF_INDEX_FIELD_NUMBER
|
static int |
OPTIONS_FIELD_NUMBER
|
static Parser |
PARSER
|
static int |
TYPE_FIELD_NUMBER
|
static int |
TYPE_NAME_FIELD_NUMBER
|
alwaysUseFieldBuildersmemoizedHashCode| Modifier and Type | Method and Description |
|---|---|
static DescriptorProtos |
getDefaultInstance()
|
DescriptorProtos |
getDefaultInstanceForType()
Get an instance of the type with no fields set.
|
String |
getDefaultValue()
optional string default_value = 7;
|
ByteString |
getDefaultValueBytes()
optional string default_value = 7;
|
static Descriptors |
getDescriptor()
|
String |
getExtendee()
optional string extendee = 2;
|
ByteString |
getExtendeeBytes()
optional string extendee = 2;
|
DescriptorProtos |
getLabel()
optional .google.protobuf.FieldDescriptorProto.Label label = 4;
|
String |
getName()
optional string name = 1;
|
ByteString |
getNameBytes()
optional string name = 1;
|
int |
getNumber()
optional int32 number = 3;
|
int |
getOneofIndex()
optional int32 oneof_index = 9;
|
DescriptorProtos |
getOptions()
optional .google.protobuf.FieldOptions options = 8;
|
DescriptorProtos |
getOptionsOrBuilder()
optional .google.protobuf.FieldOptions options = 8;
|
Parser |
getParserForType()
Gets the parser for a message of the same type as this message.
|
int |
getSerializedSize()
Get the number of bytes required to encode this message.
|
DescriptorProtos |
getType()
optional .google.protobuf.FieldDescriptorProto.Type type = 5;
|
String |
getTypeName()
optional string type_name = 6;
|
ByteString |
getTypeNameBytes()
optional string type_name = 6;
|
UnknownFieldSet |
getUnknownFields()
Get the
UnknownFieldSet for this message.
|
boolean |
hasDefaultValue()
optional string default_value = 7;
|
boolean |
hasExtendee()
optional string extendee = 2;
|
boolean |
hasLabel()
optional .google.protobuf.FieldDescriptorProto.Label label = 4;
|
boolean |
hasName()
optional string name = 1;
|
boolean |
hasNumber()
optional int32 number = 3;
|
boolean |
hasOneofIndex()
optional int32 oneof_index = 9;
|
boolean |
hasOptions()
optional .google.protobuf.FieldOptions options = 8;
|
boolean |
hasType()
optional .google.protobuf.FieldDescriptorProto.Type type = 5;
|
boolean |
hasTypeName()
optional string type_name = 6;
|
protected GeneratedMessage |
internalGetFieldAccessorTable()
Get the FieldAccessorTable for this type.
|
boolean |
isInitialized()
Returns true if all required fields in the message and all embedded messages are set, false otherwise.
|
static DescriptorProtos |
newBuilder()
|
static DescriptorProtos |
newBuilder(DescriptorProtos
|
DescriptorProtos |
newBuilderForType()
Constructs a new builder for a message of the same type as this message.
|
protected DescriptorProtos |
newBuilderForType(GeneratedMessage
|
static DescriptorProtos |
parseDelimitedFrom(InputStream
|
static DescriptorProtos |
parseDelimitedFrom(InputStream
|
static DescriptorProtos |
parseFrom(byte[] data)
|
static DescriptorProtos |
parseFrom(byte[] data, ExtensionRegistryLite
|
static DescriptorProtos |
parseFrom(ByteString
|
static DescriptorProtos |
parseFrom(ByteString
|
static DescriptorProtos |
parseFrom(CodedInputStream
|
static DescriptorProtos |
parseFrom(CodedInputStream
|
static DescriptorProtos |
parseFrom(InputStream
|
static DescriptorProtos |
parseFrom(InputStream
|
DescriptorProtos |
toBuilder()
Constructs a builder initialized with the current message.
|
protected Object |
writeReplace()
Replaces this object in the output stream with a serialized form.
|
void |
writeTo(CodedOutputStream
Serializes the message and writes it to
output.
|
getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, makeExtensionsImmutable, newFileScopedGeneratedExtension, newFileScopedGeneratedExtension, newMessageScopedGeneratedExtension, newMessageScopedGeneratedExtension, parseUnknownFieldequals, findInitializationErrors, getInitializationErrorString, hashCode, hashFields, toStringcheckByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneoftoByteArray, toByteString, writeDelimitedTo, writeTopublic static Parser<DescriptorProtos .FieldDescriptorProto > PARSER
public static final int NAME_FIELD_NUMBER
public static final int NUMBER_FIELD_NUMBER
public static final int LABEL_FIELD_NUMBER
public static final int TYPE_FIELD_NUMBER
public static final int TYPE_NAME_FIELD_NUMBER
public static final int EXTENDEE_FIELD_NUMBER
public static final int DEFAULT_VALUE_FIELD_NUMBER
public static final int ONEOF_INDEX_FIELD_NUMBER
public static final int OPTIONS_FIELD_NUMBER
public static DescriptorProtos.FieldDescriptorProto getDefaultInstance()
public DescriptorProtos.FieldDescriptorProto getDefaultInstanceForType()
MessageLiteOrBuilder
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.
public final UnknownFieldSetgetUnknownFields()
MessageOrBuilder
UnknownFieldSet for this message.
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
GeneratedMessage
public Parser<DescriptorProtos .FieldDescriptorProto > getParserForType()
MessageLite
public boolean hasName()
optional string name = 1;
public StringgetName()
optional string name = 1;
public ByteStringgetNameBytes()
optional string name = 1;
public boolean hasNumber()
optional int32 number = 3;
public int getNumber()
optional int32 number = 3;
public boolean hasLabel()
optional .google.protobuf.FieldDescriptorProto.Label label = 4;
public DescriptorProtos.FieldDescriptorProto .Label getLabel()
optional .google.protobuf.FieldDescriptorProto.Label label = 4;
public boolean hasType()
optional .google.protobuf.FieldDescriptorProto.Type type = 5;
If type_name is set, this need not be set. If both this and type_name are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
public DescriptorProtos.FieldDescriptorProto .Type getType()
optional .google.protobuf.FieldDescriptorProto.Type type = 5;
If type_name is set, this need not be set. If both this and type_name are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.
public boolean hasTypeName()
optional string type_name = 6;
For message and enum types, this is the name of the type. If the name starts with a '.', it is fully-qualified. Otherwise, C++-like scoping rules are used to find the type (i.e. first the nested types within this message are searched, then within the parent, on up to the root namespace).
public StringgetTypeName()
optional string type_name = 6;
For message and enum types, this is the name of the type. If the name starts with a '.', it is fully-qualified. Otherwise, C++-like scoping rules are used to find the type (i.e. first the nested types within this message are searched, then within the parent, on up to the root namespace).
public ByteStringgetTypeNameBytes()
optional string type_name = 6;
For message and enum types, this is the name of the type. If the name starts with a '.', it is fully-qualified. Otherwise, C++-like scoping rules are used to find the type (i.e. first the nested types within this message are searched, then within the parent, on up to the root namespace).
public boolean hasExtendee()
optional string extendee = 2;
For extensions, this is the name of the type being extended. It is resolved in the same manner as type_name.
public StringgetExtendee()
optional string extendee = 2;
For extensions, this is the name of the type being extended. It is resolved in the same manner as type_name.
public ByteStringgetExtendeeBytes()
optional string extendee = 2;
For extensions, this is the name of the type being extended. It is resolved in the same manner as type_name.
public boolean hasDefaultValue()
optional string default_value = 7;
For numeric types, contains the original text representation of the value. For booleans, "true" or "false". For strings, contains the default text contents (not escaped in any way). For bytes, contains the C escaped value. All bytes >= 128 are escaped. TODO(kenton): Base-64 encode?
public StringgetDefaultValue()
optional string default_value = 7;
For numeric types, contains the original text representation of the value. For booleans, "true" or "false". For strings, contains the default text contents (not escaped in any way). For bytes, contains the C escaped value. All bytes >= 128 are escaped. TODO(kenton): Base-64 encode?
public ByteStringgetDefaultValueBytes()
optional string default_value = 7;
For numeric types, contains the original text representation of the value. For booleans, "true" or "false". For strings, contains the default text contents (not escaped in any way). For bytes, contains the C escaped value. All bytes >= 128 are escaped. TODO(kenton): Base-64 encode?
public boolean hasOneofIndex()
optional int32 oneof_index = 9;
If set, gives the index of a oneof in the containing type's oneof_decl list. This field is a member of that oneof. Extensions of a oneof should not set this since the oneof to which they belong will be inferred based on the extension range containing the extension's field number.
public int getOneofIndex()
optional int32 oneof_index = 9;
If set, gives the index of a oneof in the containing type's oneof_decl list. This field is a member of that oneof. Extensions of a oneof should not set this since the oneof to which they belong will be inferred based on the extension range containing the extension's field number.
public boolean hasOptions()
optional .google.protobuf.FieldOptions options = 8;
public DescriptorProtos.FieldOptions getOptions()
optional .google.protobuf.FieldOptions options = 8;
public DescriptorProtos.FieldOptionsOrBuilder getOptionsOrBuilder()
optional .google.protobuf.FieldOptions options = 8;
public final boolean isInitialized()
MessageLiteOrBuilder
public void writeTo(CodedOutputStreamoutput) throws IOException
MessageLite
output. This does not flush or close the stream.
writeTo in interface
MessageLite
writeTo in class
AbstractMessage
IOException
public int getSerializedSize()
MessageLite
protected ObjectwriteReplace() throws ObjectStreamException
GeneratedMessage
return super.writeReplace();
writeReplace in class
GeneratedMessage
ObjectStreamException
public static DescriptorProtos.FieldDescriptorProto parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static DescriptorProtos.FieldDescriptorProto parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static DescriptorProtos.FieldDescriptorProto parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static DescriptorProtos.FieldDescriptorProto parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferException
public static DescriptorProtos.FieldDescriptorProto parseFrom(InputStream input) throws IOException
IOException
public static DescriptorProtos.FieldDescriptorProto parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static DescriptorProtos.FieldDescriptorProto parseDelimitedFrom(InputStream input) throws IOException
IOException
public static DescriptorProtos.FieldDescriptorProto parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static DescriptorProtos.FieldDescriptorProto parseFrom(CodedInputStream input) throws IOException
IOException
public static DescriptorProtos.FieldDescriptorProto parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static DescriptorProtos.FieldDescriptorProto .Builder newBuilder()
public DescriptorProtos.FieldDescriptorProto .Builder newBuilderForType()
MessageLite
public static DescriptorProtos.FieldDescriptorProto .Builder newBuilder(DescriptorProtos .FieldDescriptorProto prototype)
public DescriptorProtos.FieldDescriptorProto .Builder toBuilder()
MessageLite
protected DescriptorProtos.FieldDescriptorProto .Builder newBuilderForType(GeneratedMessage .BuilderParent parent)