public static final class DescriptorProtos.FieldDescriptorProto extends GeneratedMessageLite<DescriptorProtos.FieldDescriptorProto,DescriptorProtos.FieldDescriptorProto.Builder> implements DescriptorProtos.FieldDescriptorProtoOrBuilder
Describes a field within a message.Protobuf type
google.protobuf.FieldDescriptorProto
Modifier and Type | Class and Description |
---|---|
static class |
DescriptorProtos.FieldDescriptorProto.Builder
Describes a field within a message.
|
static class |
DescriptorProtos.FieldDescriptorProto.Label
Protobuf enum
google.protobuf.FieldDescriptorProto.Label |
static class |
DescriptorProtos.FieldDescriptorProto.Type
Protobuf enum
google.protobuf.FieldDescriptorProto.Type |
GeneratedMessageLite.DefaultInstanceBasedParser<T extends GeneratedMessageLite<T,?>>, GeneratedMessageLite.ExtendableBuilder<MessageType extends GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageLite.ExtendableMessage<MessageType extends GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageLite.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageLite.ExtendableMessage<MessageType,BuilderType>,BuilderType extends GeneratedMessageLite.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageLite.GeneratedExtension<ContainingType extends MessageLite,Type>, GeneratedMessageLite.MergeFromVisitor, GeneratedMessageLite.MethodToInvoke, GeneratedMessageLite.SerializedForm, GeneratedMessageLite.Visitor
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_VALUE_FIELD_NUMBER |
static int |
EXTENDEE_FIELD_NUMBER |
static int |
JSON_NAME_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 int |
TYPE_FIELD_NUMBER |
static int |
TYPE_NAME_FIELD_NUMBER |
memoizedSerializedSize, unknownFields
memoizedHashCode
Modifier and Type | Method and Description |
---|---|
protected Object |
dynamicMethod(GeneratedMessageLite.MethodToInvoke method,
Object arg0,
Object arg1)
A method that implements different types of operations described in
GeneratedMessageLite.MethodToInvoke . |
static DescriptorProtos.FieldDescriptorProto |
getDefaultInstance() |
String |
getDefaultValue()
For numeric types, contains the original text representation of the value.
|
ByteString |
getDefaultValueBytes()
For numeric types, contains the original text representation of the value.
|
String |
getExtendee()
For extensions, this is the name of the type being extended.
|
ByteString |
getExtendeeBytes()
For extensions, this is the name of the type being extended.
|
String |
getJsonName()
JSON name of this field.
|
ByteString |
getJsonNameBytes()
JSON name of this field.
|
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()
If set, gives the index of a oneof in the containing type's oneof_decl
list.
|
DescriptorProtos.FieldOptions |
getOptions()
optional .google.protobuf.FieldOptions options = 8; |
int |
getSerializedSize()
Get the number of bytes required to encode this message.
|
DescriptorProtos.FieldDescriptorProto.Type |
getType()
If type_name is set, this need not be set.
|
String |
getTypeName()
For message and enum types, this is the name of the type.
|
ByteString |
getTypeNameBytes()
For message and enum types, this is the name of the type.
|
boolean |
hasDefaultValue()
For numeric types, contains the original text representation of the value.
|
boolean |
hasExtendee()
For extensions, this is the name of the type being extended.
|
boolean |
hasJsonName()
JSON name of this field.
|
boolean |
hasLabel()
optional .google.protobuf.FieldDescriptorProto.Label label = 4; |
boolean |
hasName()
optional string name = 1; |
boolean |
hasNumber()
optional int32 number = 3; |
boolean |
hasOneofIndex()
If set, gives the index of a oneof in the containing type's oneof_decl
list.
|
boolean |
hasOptions()
optional .google.protobuf.FieldOptions options = 8; |
boolean |
hasType()
If type_name is set, this need not be set.
|
boolean |
hasTypeName()
For message and enum types, this is the name of the type.
|
static DescriptorProtos.FieldDescriptorProto.Builder |
newBuilder() |
static DescriptorProtos.FieldDescriptorProto.Builder |
newBuilder(DescriptorProtos.FieldDescriptorProto prototype) |
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() |
void |
writeTo(CodedOutputStream output)
Serializes the message and writes it to
output . |
dynamicMethod, dynamicMethod, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, emptyProtobufList, equals, getDefaultInstanceForType, getParserForType, hashCode, isInitialized, isInitialized, makeImmutable, makeImmutable, mergeLengthDelimitedField, mergeUnknownFields, mergeVarintField, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBuilderForType, newRepeatedGeneratedExtension, newSingularGeneratedExtension, parseDelimitedFrom, parseDelimitedFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parseFrom, parsePartialFrom, parseUnknownField, toBuilder, toString
addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getDefaultInstanceForType, isInitialized
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 JSON_NAME_FIELD_NUMBER
public static final int OPTIONS_FIELD_NUMBER
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()
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.
optional .google.protobuf.FieldDescriptorProto.Type type = 5;
hasType
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public DescriptorProtos.FieldDescriptorProto.Type getType()
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.
optional .google.protobuf.FieldDescriptorProto.Type type = 5;
getType
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public boolean hasTypeName()
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).
optional string type_name = 6;
hasTypeName
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public String getTypeName()
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).
optional string type_name = 6;
getTypeName
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public ByteString getTypeNameBytes()
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).
optional string type_name = 6;
getTypeNameBytes
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public boolean hasExtendee()
For extensions, this is the name of the type being extended. It is resolved in the same manner as type_name.
optional string extendee = 2;
hasExtendee
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public String getExtendee()
For extensions, this is the name of the type being extended. It is resolved in the same manner as type_name.
optional string extendee = 2;
getExtendee
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public ByteString getExtendeeBytes()
For extensions, this is the name of the type being extended. It is resolved in the same manner as type_name.
optional string extendee = 2;
getExtendeeBytes
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public boolean hasDefaultValue()
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?
optional string default_value = 7;
hasDefaultValue
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public String getDefaultValue()
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?
optional string default_value = 7;
getDefaultValue
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public ByteString getDefaultValueBytes()
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?
optional string default_value = 7;
getDefaultValueBytes
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public boolean hasOneofIndex()
If set, gives the index of a oneof in the containing type's oneof_decl list. This field is a member of that oneof.
optional int32 oneof_index = 9;
hasOneofIndex
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public int getOneofIndex()
If set, gives the index of a oneof in the containing type's oneof_decl list. This field is a member of that oneof.
optional int32 oneof_index = 9;
getOneofIndex
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public boolean hasJsonName()
JSON name of this field. The value is set by protocol compiler. If the user has set a "json_name" option on this field, that option's value will be used. Otherwise, it's deduced from the field's name by converting it to camelCase.
optional string json_name = 10;
hasJsonName
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public String getJsonName()
JSON name of this field. The value is set by protocol compiler. If the user has set a "json_name" option on this field, that option's value will be used. Otherwise, it's deduced from the field's name by converting it to camelCase.
optional string json_name = 10;
getJsonName
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public ByteString getJsonNameBytes()
JSON name of this field. The value is set by protocol compiler. If the user has set a "json_name" option on this field, that option's value will be used. Otherwise, it's deduced from the field's name by converting it to camelCase.
optional string json_name = 10;
getJsonNameBytes
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 void writeTo(CodedOutputStream output) throws IOException
MessageLite
output
. This does not
flush or close the stream.writeTo
in interface MessageLite
IOException
public int getSerializedSize()
MessageLite
getSerializedSize
in interface MessageLite
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 static DescriptorProtos.FieldDescriptorProto.Builder newBuilder(DescriptorProtos.FieldDescriptorProto prototype)
protected final Object dynamicMethod(GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
GeneratedMessageLite
GeneratedMessageLite.MethodToInvoke
.
Theses different kinds of operations are required to implement message-level operations for
builders in the runtime. This method bundles those operations to reduce the generated methods
count.
MERGE_FROM_STREAM
is parameterized with an CodedInputStream
and
ExtensionRegistryLite
. It consumes the input stream, parsing the contents into the
returned protocol buffer. If parsing throws an InvalidProtocolBufferException
, the
implementation wraps it in a RuntimeException.
NEW_INSTANCE
returns a new instance of the protocol buffer that has not yet been
made immutable. See MAKE_IMMUTABLE
.
IS_INITIALIZED
is parameterized with a Boolean
detailing whether to
memoize. It returns null
for false and the default instance for true. We optionally
memoize to support the Builder case, where memoization is not desired.
NEW_BUILDER
returns a BuilderType
instance.
VISIT
is parameterized with a Visitor
and a MessageType
and
recursively iterates through the fields side by side between this and the instance.
MAKE_IMMUTABLE
sets all internal fields to an immutable state.
For use by generated code only.
public static DescriptorProtos.FieldDescriptorProto getDefaultInstance()
public static Parser<DescriptorProtos.FieldDescriptorProto> parser()
Copyright © 2008–2016 Google. All rights reserved.