public static final class DescriptorProtos.FieldDescriptorProto extends GeneratedMessage implements DescriptorProtos.FieldDescriptorProtoOrBuilder
google.protobuf.FieldDescriptorProto
Describes a field within a message.
Modifier and Type | Class and Description |
---|---|
static class |
DescriptorProtos.FieldDescriptorProto.Builder
Protobuf type
google.protobuf.FieldDescriptorProto |
static class |
DescriptorProtos.FieldDescriptorProto.Label
Protobuf enum
google.protobuf.FieldDescriptorProto.Label |
static class |
DescriptorProtos.FieldDescriptorProto.Type
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<DescriptorProtos.FieldDescriptorProto> |
PARSER
Deprecated.
|
static int |
TYPE_FIELD_NUMBER |
static int |
TYPE_NAME_FIELD_NUMBER |
alwaysUseFieldBuilders, unknownFields
memoizedSize
memoizedHashCode
Modifier and Type | Method and Description |
---|---|
static DescriptorProtos.FieldDescriptorProto |
getDefaultInstance() |
DescriptorProtos.FieldDescriptorProto |
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.Descriptor |
getDescriptor() |
String |
getExtendee()
optional string extendee = 2; |
ByteString |
getExtendeeBytes()
optional string extendee = 2; |
DescriptorProtos.FieldDescriptorProto.Label |
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.FieldOptions |
getOptions()
optional .google.protobuf.FieldOptions options = 8; |
DescriptorProtos.FieldOptionsOrBuilder |
getOptionsOrBuilder()
optional .google.protobuf.FieldOptions options = 8; |
Parser<DescriptorProtos.FieldDescriptorProto> |
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.FieldDescriptorProto.Type |
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.FieldAccessorTable |
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.FieldDescriptorProto.Builder |
newBuilder() |
static DescriptorProtos.FieldDescriptorProto.Builder |
newBuilder(DescriptorProtos.FieldDescriptorProto prototype) |
DescriptorProtos.FieldDescriptorProto.Builder |
newBuilderForType()
Constructs a new builder for a message of the same type as this message.
|
protected DescriptorProtos.FieldDescriptorProto.Builder |
newBuilderForType(GeneratedMessage.BuilderParent parent) |
static DescriptorProtos.FieldDescriptorProto |
parseDelimitedFrom(InputStream input) |
static DescriptorProtos.FieldDescriptorProto |
parseDelimitedFrom(InputStream input,
ExtensionRegistryLite extensionRegistry) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(byte[] data) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(byte[] data,
ExtensionRegistryLite extensionRegistry) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(ByteString data) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(ByteString data,
ExtensionRegistryLite extensionRegistry) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(CodedInputStream input) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(InputStream input) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Parser<DescriptorProtos.FieldDescriptorProto> |
parser() |
DescriptorProtos.FieldDescriptorProto.Builder |
toBuilder()
Constructs a builder initialized with the current message.
|
void |
writeTo(CodedOutputStream output)
Serializes the message and writes it to
output . |
computeStringSize, computeStringSizeNoTag, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, newFileScopedGeneratedExtension, newFileScopedGeneratedExtension, newMessageScopedGeneratedExtension, newMessageScopedGeneratedExtension, parseUnknownField, writeReplace, writeString, writeStringNoTag
equals, findInitializationErrors, getInitializationErrorString, hashCode, hashFields, toString
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof
toByteArray, toByteString, writeDelimitedTo, writeTo
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
@Deprecated public static final Parser<DescriptorProtos.FieldDescriptorProto> PARSER
public final UnknownFieldSet getUnknownFields()
MessageOrBuilder
UnknownFieldSet
for this message.getUnknownFields
in interface MessageOrBuilder
getUnknownFields
in class GeneratedMessage
public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
GeneratedMessage
internalGetFieldAccessorTable
in class GeneratedMessage
public boolean hasName()
optional string name = 1;
hasName
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public String getName()
optional string name = 1;
getName
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public ByteString getNameBytes()
optional string name = 1;
getNameBytes
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public boolean hasNumber()
optional int32 number = 3;
hasNumber
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public int getNumber()
optional int32 number = 3;
getNumber
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public boolean hasLabel()
optional .google.protobuf.FieldDescriptorProto.Label label = 4;
hasLabel
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public DescriptorProtos.FieldDescriptorProto.Label getLabel()
optional .google.protobuf.FieldDescriptorProto.Label label = 4;
getLabel
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
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.
hasType
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
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.
getType
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
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).
hasTypeName
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public String getTypeName()
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).
getTypeName
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public ByteString getTypeNameBytes()
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).
getTypeNameBytes
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
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.
hasExtendee
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public String getExtendee()
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.
getExtendee
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public ByteString getExtendeeBytes()
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.
getExtendeeBytes
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
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?
hasDefaultValue
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public String getDefaultValue()
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?
getDefaultValue
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public ByteString getDefaultValueBytes()
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?
getDefaultValueBytes
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
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.
hasOneofIndex
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
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.
getOneofIndex
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public boolean hasOptions()
optional .google.protobuf.FieldOptions options = 8;
hasOptions
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public DescriptorProtos.FieldOptions getOptions()
optional .google.protobuf.FieldOptions options = 8;
getOptions
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public DescriptorProtos.FieldOptionsOrBuilder getOptionsOrBuilder()
optional .google.protobuf.FieldOptions options = 8;
getOptionsOrBuilder
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public final boolean isInitialized()
MessageLiteOrBuilder
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class GeneratedMessage
public void writeTo(CodedOutputStream output) throws IOException
MessageLite
output
. This does not
flush or close the stream.writeTo
in interface MessageLite
writeTo
in class GeneratedMessage
IOException
public int getSerializedSize()
MessageLite
getSerializedSize
in interface MessageLite
getSerializedSize
in class GeneratedMessage
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 DescriptorProtos.FieldDescriptorProto.Builder newBuilderForType()
MessageLite
newBuilderForType
in interface Message
newBuilderForType
in interface MessageLite
public static DescriptorProtos.FieldDescriptorProto.Builder newBuilder()
public static DescriptorProtos.FieldDescriptorProto.Builder newBuilder(DescriptorProtos.FieldDescriptorProto prototype)
public DescriptorProtos.FieldDescriptorProto.Builder toBuilder()
MessageLite
toBuilder
in interface Message
toBuilder
in interface MessageLite
protected DescriptorProtos.FieldDescriptorProto.Builder newBuilderForType(GeneratedMessage.BuilderParent parent)
newBuilderForType
in class GeneratedMessage
public static DescriptorProtos.FieldDescriptorProto getDefaultInstance()
public static Parser<DescriptorProtos.FieldDescriptorProto> parser()
public Parser<DescriptorProtos.FieldDescriptorProto> getParserForType()
MessageLite
getParserForType
in interface Message
getParserForType
in interface MessageLite
getParserForType
in class GeneratedMessage
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.getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
Copyright © 2008–2015 Google. All rights reserved.