public final class Field extends com.google.protobuf.GeneratedMessageV3 implements FieldOrBuilder
A single field of a message type.Protobuf type
google.protobuf.Field| Modifier and Type | Class and Description |
|---|---|
static class |
Field.Builder
A single field of a message type.
|
static class |
Field.Cardinality
Whether a field is optional, required, or repeated.
|
static class |
Field.Kind
Basic field types.
|
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| Modifier and Type | Field and Description |
|---|---|
static int |
CARDINALITY_FIELD_NUMBER |
static int |
DEFAULT_VALUE_FIELD_NUMBER |
static int |
JSON_NAME_FIELD_NUMBER |
static int |
KIND_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 |
PACKED_FIELD_NUMBER |
static int |
TYPE_URL_FIELD_NUMBER |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
Field.Cardinality |
getCardinality()
The field cardinality.
|
int |
getCardinalityValue()
The field cardinality.
|
static Field |
getDefaultInstance() |
Field |
getDefaultInstanceForType() |
java.lang.String |
getDefaultValue()
The string value of the default value of this field.
|
com.google.protobuf.ByteString |
getDefaultValueBytes()
The string value of the default value of this field.
|
static com.google.protobuf.Descriptors.Descriptor |
getDescriptor() |
java.lang.String |
getJsonName()
The field JSON name.
|
com.google.protobuf.ByteString |
getJsonNameBytes()
The field JSON name.
|
Field.Kind |
getKind()
The field type.
|
int |
getKindValue()
The field type.
|
java.lang.String |
getName()
The field name.
|
com.google.protobuf.ByteString |
getNameBytes()
The field name.
|
int |
getNumber()
The field number.
|
int |
getOneofIndex()
The index of the field type in `Type.oneofs`, for message or enumeration
types.
|
Option |
getOptions(int index)
The protocol buffer options.
|
int |
getOptionsCount()
The protocol buffer options.
|
java.util.List<Option> |
getOptionsList()
The protocol buffer options.
|
OptionOrBuilder |
getOptionsOrBuilder(int index)
The protocol buffer options.
|
java.util.List<? extends OptionOrBuilder> |
getOptionsOrBuilderList()
The protocol buffer options.
|
boolean |
getPacked()
Whether to use alternative packed wire representation.
|
com.google.protobuf.Parser<Field> |
getParserForType() |
int |
getSerializedSize() |
java.lang.String |
getTypeUrl()
The field type URL, without the scheme, for message or enumeration
types.
|
com.google.protobuf.ByteString |
getTypeUrlBytes()
The field type URL, without the scheme, for message or enumeration
types.
|
com.google.protobuf.UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static Field.Builder |
newBuilder() |
static Field.Builder |
newBuilder(Field prototype) |
Field.Builder |
newBuilderForType() |
protected Field.Builder |
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) |
static Field |
parseDelimitedFrom(java.io.InputStream input) |
static Field |
parseDelimitedFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Field |
parseFrom(byte[] data) |
static Field |
parseFrom(byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Field |
parseFrom(java.nio.ByteBuffer data) |
static Field |
parseFrom(java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Field |
parseFrom(com.google.protobuf.ByteString data) |
static Field |
parseFrom(com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Field |
parseFrom(com.google.protobuf.CodedInputStream input) |
static Field |
parseFrom(com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static Field |
parseFrom(java.io.InputStream input) |
static Field |
parseFrom(java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry) |
static com.google.protobuf.Parser<Field> |
parser() |
Field.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, makeExtensionsImmutable, 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, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic static final int KIND_FIELD_NUMBER
public static final int CARDINALITY_FIELD_NUMBER
public static final int NUMBER_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
public static final int TYPE_URL_FIELD_NUMBER
public static final int ONEOF_INDEX_FIELD_NUMBER
public static final int PACKED_FIELD_NUMBER
public static final int OPTIONS_FIELD_NUMBER
public static final int JSON_NAME_FIELD_NUMBER
public static final int DEFAULT_VALUE_FIELD_NUMBER
public final com.google.protobuf.UnknownFieldSet getUnknownFields()
getUnknownFields in interface com.google.protobuf.MessageOrBuildergetUnknownFields in class com.google.protobuf.GeneratedMessageV3public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3public int getKindValue()
The field type.
.google.protobuf.Field.Kind kind = 1;getKindValue in interface FieldOrBuilderpublic Field.Kind getKind()
The field type.
.google.protobuf.Field.Kind kind = 1;getKind in interface FieldOrBuilderpublic int getCardinalityValue()
The field cardinality.
.google.protobuf.Field.Cardinality cardinality = 2;getCardinalityValue in interface FieldOrBuilderpublic Field.Cardinality getCardinality()
The field cardinality.
.google.protobuf.Field.Cardinality cardinality = 2;getCardinality in interface FieldOrBuilderpublic int getNumber()
The field number.
int32 number = 3;getNumber in interface FieldOrBuilderpublic java.lang.String getName()
The field name.
string name = 4;getName in interface FieldOrBuilderpublic com.google.protobuf.ByteString getNameBytes()
The field name.
string name = 4;getNameBytes in interface FieldOrBuilderpublic java.lang.String getTypeUrl()
The field type URL, without the scheme, for message or enumeration types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
string type_url = 6;getTypeUrl in interface FieldOrBuilderpublic com.google.protobuf.ByteString getTypeUrlBytes()
The field type URL, without the scheme, for message or enumeration types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
string type_url = 6;getTypeUrlBytes in interface FieldOrBuilderpublic int getOneofIndex()
The index of the field type in `Type.oneofs`, for message or enumeration types. The first type has index 1; zero means the type is not in the list.
int32 oneof_index = 7;getOneofIndex in interface FieldOrBuilderpublic boolean getPacked()
Whether to use alternative packed wire representation.
bool packed = 8;getPacked in interface FieldOrBuilderpublic java.util.List<Option> getOptionsList()
The protocol buffer options.
repeated .google.protobuf.Option options = 9;getOptionsList in interface FieldOrBuilderpublic java.util.List<? extends OptionOrBuilder> getOptionsOrBuilderList()
The protocol buffer options.
repeated .google.protobuf.Option options = 9;getOptionsOrBuilderList in interface FieldOrBuilderpublic int getOptionsCount()
The protocol buffer options.
repeated .google.protobuf.Option options = 9;getOptionsCount in interface FieldOrBuilderpublic Option getOptions(int index)
The protocol buffer options.
repeated .google.protobuf.Option options = 9;getOptions in interface FieldOrBuilderpublic OptionOrBuilder getOptionsOrBuilder(int index)
The protocol buffer options.
repeated .google.protobuf.Option options = 9;getOptionsOrBuilder in interface FieldOrBuilderpublic java.lang.String getJsonName()
The field JSON name.
string json_name = 10;getJsonName in interface FieldOrBuilderpublic com.google.protobuf.ByteString getJsonNameBytes()
The field JSON name.
string json_name = 10;getJsonNameBytes in interface FieldOrBuilderpublic java.lang.String getDefaultValue()
The string value of the default value of this field. Proto2 syntax only.
string default_value = 11;getDefaultValue in interface FieldOrBuilderpublic com.google.protobuf.ByteString getDefaultValueBytes()
The string value of the default value of this field. Proto2 syntax only.
string default_value = 11;getDefaultValueBytes in interface FieldOrBuilderpublic final boolean isInitialized()
isInitialized in interface com.google.protobuf.MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException
writeTo in interface com.google.protobuf.MessageLitewriteTo in class com.google.protobuf.GeneratedMessageV3java.io.IOExceptionpublic int getSerializedSize()
getSerializedSize in interface com.google.protobuf.MessageLitegetSerializedSize in class com.google.protobuf.GeneratedMessageV3public boolean equals(java.lang.Object obj)
equals in interface com.google.protobuf.Messageequals in class com.google.protobuf.AbstractMessagepublic int hashCode()
hashCode in interface com.google.protobuf.MessagehashCode in class com.google.protobuf.AbstractMessagepublic static Field parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Field parseFrom(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Field parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Field parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Field parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Field parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
com.google.protobuf.InvalidProtocolBufferExceptionpublic static Field parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static Field parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static Field parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static Field parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static Field parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static Field parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic Field.Builder newBuilderForType()
newBuilderForType in interface com.google.protobuf.MessagenewBuilderForType in interface com.google.protobuf.MessageLitepublic static Field.Builder newBuilder()
public static Field.Builder newBuilder(Field prototype)
public Field.Builder toBuilder()
toBuilder in interface com.google.protobuf.MessagetoBuilder in interface com.google.protobuf.MessageLiteprotected Field.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class com.google.protobuf.GeneratedMessageV3public static Field getDefaultInstance()
public static com.google.protobuf.Parser<Field> parser()
public com.google.protobuf.Parser<Field> getParserForType()
getParserForType in interface com.google.protobuf.MessagegetParserForType in interface com.google.protobuf.MessageLitegetParserForType in class com.google.protobuf.GeneratedMessageV3public Field getDefaultInstanceForType()
getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuildergetDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder