public static final class DescriptorProtos.FieldDescriptorProto extends com.google.protobuf.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 |
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage,BuilderType extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
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 com.google.protobuf.Parser<DescriptorProtos.FieldDescriptorProto> |
PARSER
Deprecated.
|
static int |
PROTO3_OPTIONAL_FIELD_NUMBER |
static int |
TYPE_FIELD_NUMBER |
static int |
TYPE_NAME_FIELD_NUMBER |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
static DescriptorProtos.FieldDescriptorProto |
getDefaultInstance() |
DescriptorProtos.FieldDescriptorProto |
getDefaultInstanceForType() |
String |
getDefaultValue()
For numeric types, contains the original text representation of the value.
|
com.google.protobuf.ByteString |
getDefaultValueBytes()
For numeric types, contains the original text representation of the value.
|
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
String |
getExtendee()
For extensions, this is the name of the type being extended.
|
com.google.protobuf.ByteString |
getExtendeeBytes()
For extensions, this is the name of the type being extended.
|
String |
getJsonName()
JSON name of this field.
|
com.google.protobuf.ByteString |
getJsonNameBytes()
JSON name of this field.
|
DescriptorProtos.FieldDescriptorProto.Label |
getLabel()
optional .google.protobuf.FieldDescriptorProto.Label label = 4; |
String |
getName()
optional string name = 1; |
com.google.protobuf.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; |
com.google.protobuf.Parser<DescriptorProtos.FieldDescriptorProto> |
getParserForType() |
boolean |
getProto3Optional()
If true, this is a proto3 "optional".
|
int |
getSerializedSize() |
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.
|
com.google.protobuf.ByteString |
getTypeNameBytes()
For message and enum types, this is the name of the type.
|
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
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() |
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 |
hasProto3Optional()
If true, this is a proto3 "optional".
|
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 com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static DescriptorProtos.FieldDescriptorProto.Builder |
newBuilder() |
static DescriptorProtos.FieldDescriptorProto.Builder |
newBuilder(DescriptorProtos.FieldDescriptorProto prototype) |
DescriptorProtos.FieldDescriptorProto.Builder |
newBuilderForType() |
protected DescriptorProtos.FieldDescriptorProto.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
protected Object |
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) |
static DescriptorProtos.FieldDescriptorProto |
parseDelimitedFrom(InputStream input) |
static DescriptorProtos.FieldDescriptorProto |
parseDelimitedFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(byte[] data) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(ByteBuffer data) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(com.google.protobuf.ByteString data) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(com.google.protobuf.CodedInputStream input) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(InputStream input) |
static DescriptorProtos.FieldDescriptorProto |
parseFrom(InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<DescriptorProtos.FieldDescriptorProto> |
parser() |
DescriptorProtos.FieldDescriptorProto.Builder |
toBuilder() |
void |
writeTo(com.google.protobuf.CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
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 static final int PROTO3_OPTIONAL_FIELD_NUMBER
@Deprecated public static final com.google.protobuf.Parser<DescriptorProtos.FieldDescriptorProto> PARSER
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
newInstance
in class com.google.protobuf.GeneratedMessageV3
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields
in interface com.google.protobuf.MessageOrBuilder
getUnknownFields
in class com.google.protobuf.GeneratedMessageV3
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable
in class com.google.protobuf.GeneratedMessageV3
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 com.google.protobuf.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 com.google.protobuf.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 com.google.protobuf.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.
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.
optional string default_value = 7;
getDefaultValue
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public com.google.protobuf.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.
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 com.google.protobuf.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 DescriptorProtos.FieldOptionsOrBuilder getOptionsOrBuilder()
optional .google.protobuf.FieldOptions options = 8;
getOptionsOrBuilder
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public boolean hasProto3Optional()
If true, this is a proto3 "optional". When a proto3 field is optional, it tracks presence regardless of field type. When proto3_optional is true, this field must be belong to a oneof to signal to old proto3 clients that presence is tracked for this field. This oneof is known as a "synthetic" oneof, and this field must be its sole member (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs exist in the descriptor only, and do not generate any API. Synthetic oneofs must be ordered after all "real" oneofs. For message fields, proto3_optional doesn't create any semantic change, since non-repeated message fields always track presence. However it still indicates the semantic detail of whether the user wrote "optional" or not. This can be useful for round-tripping the .proto file. For consistency we give message fields a synthetic oneof also, even though it is not required to track presence. This is especially important because the parser can't tell if a field is a message or an enum, so it must always create a synthetic oneof. Proto2 optional fields do not set this flag, because they already indicate optional with `LABEL_OPTIONAL`.
optional bool proto3_optional = 17;
hasProto3Optional
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public boolean getProto3Optional()
If true, this is a proto3 "optional". When a proto3 field is optional, it tracks presence regardless of field type. When proto3_optional is true, this field must be belong to a oneof to signal to old proto3 clients that presence is tracked for this field. This oneof is known as a "synthetic" oneof, and this field must be its sole member (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs exist in the descriptor only, and do not generate any API. Synthetic oneofs must be ordered after all "real" oneofs. For message fields, proto3_optional doesn't create any semantic change, since non-repeated message fields always track presence. However it still indicates the semantic detail of whether the user wrote "optional" or not. This can be useful for round-tripping the .proto file. For consistency we give message fields a synthetic oneof also, even though it is not required to track presence. This is especially important because the parser can't tell if a field is a message or an enum, so it must always create a synthetic oneof. Proto2 optional fields do not set this flag, because they already indicate optional with `LABEL_OPTIONAL`.
optional bool proto3_optional = 17;
getProto3Optional
in interface DescriptorProtos.FieldDescriptorProtoOrBuilder
public final boolean isInitialized()
isInitialized
in interface com.google.protobuf.MessageLiteOrBuilder
isInitialized
in class com.google.protobuf.GeneratedMessageV3
public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
writeTo
in interface com.google.protobuf.MessageLite
writeTo
in class com.google.protobuf.GeneratedMessageV3
IOException
public int getSerializedSize()
getSerializedSize
in interface com.google.protobuf.MessageLite
getSerializedSize
in class com.google.protobuf.GeneratedMessageV3
public boolean equals(Object obj)
equals
in interface com.google.protobuf.Message
equals
in class com.google.protobuf.AbstractMessage
public int hashCode()
hashCode
in interface com.google.protobuf.Message
hashCode
in class com.google.protobuf.AbstractMessage
public static DescriptorProtos.FieldDescriptorProto parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static DescriptorProtos.FieldDescriptorProto parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static DescriptorProtos.FieldDescriptorProto parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static DescriptorProtos.FieldDescriptorProto parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static DescriptorProtos.FieldDescriptorProto parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static DescriptorProtos.FieldDescriptorProto parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferException
public static DescriptorProtos.FieldDescriptorProto parseFrom(InputStream input) throws IOException
IOException
public static DescriptorProtos.FieldDescriptorProto parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static DescriptorProtos.FieldDescriptorProto parseDelimitedFrom(InputStream input) throws IOException
IOException
public static DescriptorProtos.FieldDescriptorProto parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public static DescriptorProtos.FieldDescriptorProto parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
IOException
public static DescriptorProtos.FieldDescriptorProto parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
IOException
public DescriptorProtos.FieldDescriptorProto.Builder newBuilderForType()
newBuilderForType
in interface com.google.protobuf.Message
newBuilderForType
in interface com.google.protobuf.MessageLite
public static DescriptorProtos.FieldDescriptorProto.Builder newBuilder()
public static DescriptorProtos.FieldDescriptorProto.Builder newBuilder(DescriptorProtos.FieldDescriptorProto prototype)
public DescriptorProtos.FieldDescriptorProto.Builder toBuilder()
toBuilder
in interface com.google.protobuf.Message
toBuilder
in interface com.google.protobuf.MessageLite
protected DescriptorProtos.FieldDescriptorProto.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType
in class com.google.protobuf.GeneratedMessageV3
public static DescriptorProtos.FieldDescriptorProto getDefaultInstance()
public static com.google.protobuf.Parser<DescriptorProtos.FieldDescriptorProto> parser()
public com.google.protobuf.Parser<DescriptorProtos.FieldDescriptorProto> getParserForType()
getParserForType
in interface com.google.protobuf.Message
getParserForType
in interface com.google.protobuf.MessageLite
getParserForType
in class com.google.protobuf.GeneratedMessageV3
public DescriptorProtos.FieldDescriptorProto getDefaultInstanceForType()
getDefaultInstanceForType
in interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType
in interface com.google.protobuf.MessageOrBuilder
Copyright © 2008–2022. All rights reserved.