Package com.google.protobuf
Class Field
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
com.google.protobuf.Field
- All Implemented Interfaces:
FieldOrBuilder,com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Serializable
A single field of a message type.Protobuf type
google.protobuf.Field- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA single field of a message type.static enumWhether a field is optional, required, or repeated.static enumBasic field types.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageV3
alwaysUseFieldBuilders, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe field cardinality.intThe field cardinality.static FieldThe string value of the default value of this field.com.google.protobuf.ByteStringThe string value of the default value of this field.static final com.google.protobuf.Descriptors.DescriptorThe field JSON name.com.google.protobuf.ByteStringThe field JSON name.getKind()The field type.intThe field type.getName()The field name.com.google.protobuf.ByteStringThe field name.intThe field number.intThe index of the field type in `Type.oneofs`, for message or enumeration types.getOptions(int index) The protocol buffer options.intThe protocol buffer options.The protocol buffer options.getOptionsOrBuilder(int index) The protocol buffer options.List<? extends OptionOrBuilder>The protocol buffer options.booleanWhether to use alternative packed wire representation.com.google.protobuf.Parser<Field>intThe field type URL, without the scheme, for message or enumeration types.com.google.protobuf.ByteStringThe field type URL, without the scheme, for message or enumeration types.inthashCode()protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanstatic Field.Builderstatic Field.BuildernewBuilder(Field prototype) protected Field.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) static FieldparseDelimitedFrom(InputStream input) static FieldparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static FieldparseFrom(byte[] data) static FieldparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static FieldparseFrom(com.google.protobuf.ByteString data) static FieldparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static FieldparseFrom(com.google.protobuf.CodedInputStream input) static FieldparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static FieldparseFrom(InputStream input) static FieldparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static FieldparseFrom(ByteBuffer data) static FieldparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<Field>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, 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, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
KIND_FIELD_NUMBER
public static final int KIND_FIELD_NUMBER- See Also:
-
CARDINALITY_FIELD_NUMBER
public static final int CARDINALITY_FIELD_NUMBER- See Also:
-
NUMBER_FIELD_NUMBER
public static final int NUMBER_FIELD_NUMBER- See Also:
-
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER- See Also:
-
TYPE_URL_FIELD_NUMBER
public static final int TYPE_URL_FIELD_NUMBER- See Also:
-
ONEOF_INDEX_FIELD_NUMBER
public static final int ONEOF_INDEX_FIELD_NUMBER- See Also:
-
PACKED_FIELD_NUMBER
public static final int PACKED_FIELD_NUMBER- See Also:
-
OPTIONS_FIELD_NUMBER
public static final int OPTIONS_FIELD_NUMBER- See Also:
-
JSON_NAME_FIELD_NUMBER
public static final int JSON_NAME_FIELD_NUMBER- See Also:
-
DEFAULT_VALUE_FIELD_NUMBER
public static final int DEFAULT_VALUE_FIELD_NUMBER- See Also:
-
-
Method Details
-
newInstance
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3
-
getKindValue
public int getKindValue()The field type.
.google.protobuf.Field.Kind kind = 1;- Specified by:
getKindValuein interfaceFieldOrBuilder- Returns:
- The enum numeric value on the wire for kind.
-
getKind
The field type.
.google.protobuf.Field.Kind kind = 1;- Specified by:
getKindin interfaceFieldOrBuilder- Returns:
- The kind.
-
getCardinalityValue
public int getCardinalityValue()The field cardinality.
.google.protobuf.Field.Cardinality cardinality = 2;- Specified by:
getCardinalityValuein interfaceFieldOrBuilder- Returns:
- The enum numeric value on the wire for cardinality.
-
getCardinality
The field cardinality.
.google.protobuf.Field.Cardinality cardinality = 2;- Specified by:
getCardinalityin interfaceFieldOrBuilder- Returns:
- The cardinality.
-
getNumber
public int getNumber()The field number.
int32 number = 3;- Specified by:
getNumberin interfaceFieldOrBuilder- Returns:
- The number.
-
getName
The field name.
string name = 4;- Specified by:
getNamein interfaceFieldOrBuilder- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()The field name.
string name = 4;- Specified by:
getNameBytesin interfaceFieldOrBuilder- Returns:
- The bytes for name.
-
getTypeUrl
The field type URL, without the scheme, for message or enumeration types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
string type_url = 6;- Specified by:
getTypeUrlin interfaceFieldOrBuilder- Returns:
- The typeUrl.
-
getTypeUrlBytes
public 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;- Specified by:
getTypeUrlBytesin interfaceFieldOrBuilder- Returns:
- The bytes for typeUrl.
-
getOneofIndex
public 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;- Specified by:
getOneofIndexin interfaceFieldOrBuilder- Returns:
- The oneofIndex.
-
getPacked
public boolean getPacked()Whether to use alternative packed wire representation.
bool packed = 8;- Specified by:
getPackedin interfaceFieldOrBuilder- Returns:
- The packed.
-
getOptionsList
The protocol buffer options.
repeated .google.protobuf.Option options = 9;- Specified by:
getOptionsListin interfaceFieldOrBuilder
-
getOptionsOrBuilderList
The protocol buffer options.
repeated .google.protobuf.Option options = 9;- Specified by:
getOptionsOrBuilderListin interfaceFieldOrBuilder
-
getOptionsCount
public int getOptionsCount()The protocol buffer options.
repeated .google.protobuf.Option options = 9;- Specified by:
getOptionsCountin interfaceFieldOrBuilder
-
getOptions
The protocol buffer options.
repeated .google.protobuf.Option options = 9;- Specified by:
getOptionsin interfaceFieldOrBuilder
-
getOptionsOrBuilder
The protocol buffer options.
repeated .google.protobuf.Option options = 9;- Specified by:
getOptionsOrBuilderin interfaceFieldOrBuilder
-
getJsonName
The field JSON name.
string json_name = 10;- Specified by:
getJsonNamein interfaceFieldOrBuilder- Returns:
- The jsonName.
-
getJsonNameBytes
public com.google.protobuf.ByteString getJsonNameBytes()The field JSON name.
string json_name = 10;- Specified by:
getJsonNameBytesin interfaceFieldOrBuilder- Returns:
- The bytes for jsonName.
-
getDefaultValue
The string value of the default value of this field. Proto2 syntax only.
string default_value = 11;- Specified by:
getDefaultValuein interfaceFieldOrBuilder- Returns:
- The defaultValue.
-
getDefaultValueBytes
public com.google.protobuf.ByteString getDefaultValueBytes()The string value of the default value of this field. Proto2 syntax only.
string default_value = 11;- Specified by:
getDefaultValueBytesin interfaceFieldOrBuilder- Returns:
- The bytes for defaultValue.
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static Field parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Field parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Field parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Field parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Field parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Field parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Field parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static Field parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Field parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected Field.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) - Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-