public static final class DescriptorProtos.FieldDescriptorProto extends GeneratedMessageV3 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 |
GeneratedMessageV3.BuilderParent, GeneratedMessageV3.ExtendableBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage,BuilderType extends GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageV3.ExtendableMessage<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.FieldAccessorTable| 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 Parser<DescriptorProtos.FieldDescriptorProto> |
PARSER
Deprecated.
|
static int |
TYPE_FIELD_NUMBER |
static int |
TYPE_NAME_FIELD_NUMBER |
alwaysUseFieldBuilders, unknownFieldsmemoizedSizememoizedHashCode| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Compares the specified object with this message for equality.
|
static DescriptorProtos.FieldDescriptorProto |
getDefaultInstance() |
DescriptorProtos.FieldDescriptorProto |
getDefaultInstanceForType()
Get an instance of the type with no fields set.
|
java.lang.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.
|
static Descriptors.Descriptor |
getDescriptor() |
java.lang.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.
|
java.lang.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; |
java.lang.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; |
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()
If type_name is set, this need not be set.
|
java.lang.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.
|
UnknownFieldSet |
getUnknownFields()
Get the
UnknownFieldSet for this message. |
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.
|
int |
hashCode()
Returns the hash code value for this message.
|
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.
|
protected GeneratedMessageV3.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(GeneratedMessageV3.BuilderParent parent)
TODO(xiaofeng): remove this together with GeneratedMessageV3.BuilderParent.
|
static DescriptorProtos.FieldDescriptorProto |
parseDelimitedFrom(java.io.InputStream input) |
static DescriptorProtos.FieldDescriptorProto |
parseDelimitedFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(byte[] data) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(byte[] data,
ExtensionRegistryLite extensionRegistry) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(java.nio.ByteBuffer data) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(java.nio.ByteBuffer 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(java.io.InputStream input) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(java.io.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, newBuilderForType, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneoftoByteArray, toByteString, writeDelimitedTo, writeTopublic 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
@Deprecated public static final Parser<DescriptorProtos.FieldDescriptorProto> PARSER
public final UnknownFieldSet getUnknownFields()
MessageOrBuilderUnknownFieldSet for this message.getUnknownFields in interface MessageOrBuildergetUnknownFields in class GeneratedMessageV3public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
GeneratedMessageV3internalGetFieldAccessorTable in class GeneratedMessageV3public boolean hasName()
optional string name = 1;hasName in interface DescriptorProtos.FieldDescriptorProtoOrBuilderpublic java.lang.String getName()
optional string name = 1;getName in interface DescriptorProtos.FieldDescriptorProtoOrBuilderpublic ByteString getNameBytes()
optional string name = 1;getNameBytes in interface DescriptorProtos.FieldDescriptorProtoOrBuilderpublic boolean hasNumber()
optional int32 number = 3;hasNumber in interface DescriptorProtos.FieldDescriptorProtoOrBuilderpublic int getNumber()
optional int32 number = 3;getNumber in interface DescriptorProtos.FieldDescriptorProtoOrBuilderpublic boolean hasLabel()
optional .google.protobuf.FieldDescriptorProto.Label label = 4;hasLabel in interface DescriptorProtos.FieldDescriptorProtoOrBuilderpublic DescriptorProtos.FieldDescriptorProto.Label getLabel()
optional .google.protobuf.FieldDescriptorProto.Label label = 4;getLabel in interface DescriptorProtos.FieldDescriptorProtoOrBuilderpublic 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.FieldDescriptorProtoOrBuilderpublic 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.FieldDescriptorProtoOrBuilderpublic 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.FieldDescriptorProtoOrBuilderpublic java.lang.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.FieldDescriptorProtoOrBuilderpublic 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.FieldDescriptorProtoOrBuilderpublic 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.FieldDescriptorProtoOrBuilderpublic java.lang.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.FieldDescriptorProtoOrBuilderpublic 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.FieldDescriptorProtoOrBuilderpublic 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.FieldDescriptorProtoOrBuilderpublic java.lang.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.FieldDescriptorProtoOrBuilderpublic 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.FieldDescriptorProtoOrBuilderpublic 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.FieldDescriptorProtoOrBuilderpublic 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.FieldDescriptorProtoOrBuilderpublic 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.FieldDescriptorProtoOrBuilderpublic java.lang.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.FieldDescriptorProtoOrBuilderpublic 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.FieldDescriptorProtoOrBuilderpublic boolean hasOptions()
optional .google.protobuf.FieldOptions options = 8;hasOptions in interface DescriptorProtos.FieldDescriptorProtoOrBuilderpublic DescriptorProtos.FieldOptions getOptions()
optional .google.protobuf.FieldOptions options = 8;getOptions in interface DescriptorProtos.FieldDescriptorProtoOrBuilderpublic DescriptorProtos.FieldOptionsOrBuilder getOptionsOrBuilder()
optional .google.protobuf.FieldOptions options = 8;getOptionsOrBuilder in interface DescriptorProtos.FieldDescriptorProtoOrBuilderpublic final boolean isInitialized()
MessageLiteOrBuilderisInitialized in interface MessageLiteOrBuilderisInitialized in class GeneratedMessageV3public void writeTo(CodedOutputStream output) throws java.io.IOException
MessageLiteoutput. This does not
flush or close the stream.writeTo in interface MessageLitewriteTo in class GeneratedMessageV3java.io.IOExceptionpublic int getSerializedSize()
MessageLitegetSerializedSize in interface MessageLitegetSerializedSize in class GeneratedMessageV3public boolean equals(java.lang.Object obj)
Messagetrue 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.equals in interface Messageequals in class AbstractMessageobj - object to be compared for equality with this messagetrue if the specified object is equal to this messagepublic int hashCode()
MessageObject.hashCode() is incorrect.hashCode in interface MessagehashCode in class AbstractMessageMap.hashCode()public static DescriptorProtos.FieldDescriptorProto parseFrom(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static DescriptorProtos.FieldDescriptorProto parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static DescriptorProtos.FieldDescriptorProto parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static DescriptorProtos.FieldDescriptorProto parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static DescriptorProtos.FieldDescriptorProto parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static DescriptorProtos.FieldDescriptorProto parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static DescriptorProtos.FieldDescriptorProto parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static DescriptorProtos.FieldDescriptorProto parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static DescriptorProtos.FieldDescriptorProto parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static DescriptorProtos.FieldDescriptorProto parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static DescriptorProtos.FieldDescriptorProto parseFrom(CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static DescriptorProtos.FieldDescriptorProto parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic DescriptorProtos.FieldDescriptorProto.Builder newBuilderForType()
MessageLitenewBuilderForType in interface MessagenewBuilderForType in interface MessageLitepublic static DescriptorProtos.FieldDescriptorProto.Builder newBuilder()
public static DescriptorProtos.FieldDescriptorProto.Builder newBuilder(DescriptorProtos.FieldDescriptorProto prototype)
public DescriptorProtos.FieldDescriptorProto.Builder toBuilder()
MessageLitetoBuilder in interface MessagetoBuilder in interface MessageLiteprotected DescriptorProtos.FieldDescriptorProto.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
GeneratedMessageV3newBuilderForType in class GeneratedMessageV3public static DescriptorProtos.FieldDescriptorProto getDefaultInstance()
public static Parser<DescriptorProtos.FieldDescriptorProto> parser()
public Parser<DescriptorProtos.FieldDescriptorProto> getParserForType()
MessageLitegetParserForType in interface MessagegetParserForType in interface MessageLitegetParserForType in class GeneratedMessageV3public DescriptorProtos.FieldDescriptorProto getDefaultInstanceForType()
MessageLiteOrBuildergetDefaultInstance() 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 MessageLiteOrBuildergetDefaultInstanceForType in interface MessageOrBuilder