Send feedback Class Field (3.19.4) Stay organized with collections Save and categorize content based on your preferences.
public final class Field extends GeneratedMessageLite<Field , Field . Builder > implements FieldOrBuilder A single field of a message type.
Protobuf type google.protobuf.Field
Static Fields CARDINALITY_FIELD_NUMBER
public static final int CARDINALITY_FIELD_NUMBER Field Value Type Description int
DEFAULT_VALUE_FIELD_NUMBER
public static final int DEFAULT_VALUE_FIELD_NUMBER Field Value Type Description int
JSON_NAME_FIELD_NUMBER
public static final int JSON_NAME_FIELD_NUMBER Field Value Type Description int
KIND_FIELD_NUMBER
public static final int KIND_FIELD_NUMBER Field Value Type Description int
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER Field Value Type Description int
NUMBER_FIELD_NUMBER
public static final int NUMBER_FIELD_NUMBER Field Value Type Description int
ONEOF_INDEX_FIELD_NUMBER
public static final int ONEOF_INDEX_FIELD_NUMBER Field Value Type Description int
OPTIONS_FIELD_NUMBER
public static final int OPTIONS_FIELD_NUMBER Field Value Type Description int
PACKED_FIELD_NUMBER
public static final int PACKED_FIELD_NUMBER Field Value Type Description int
TYPE_URL_FIELD_NUMBER
public static final int TYPE_URL_FIELD_NUMBER Field Value Type Description int
Static Methods getDefaultInstance()
public static Field getDefaultInstance () Returns Type Description Field
newBuilder()
public static Field . Builder newBuilder () newBuilder(Field prototype)
public static Field . Builder newBuilder ( Field prototype ) Parameter Name Description prototype Field
public static Field parseDelimitedFrom ( InputStream input ) Returns Type Description Field
public static Field parseDelimitedFrom ( InputStream input , ExtensionRegistryLite extensionRegistry ) Returns Type Description Field
parseFrom(byte[] data)
public static Field parseFrom ( byte [] data ) Parameter Name Description data byte []
Returns Type Description Field
parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
public static Field parseFrom ( byte [] data , ExtensionRegistryLite extensionRegistry ) Returns Type Description Field
parseFrom(ByteString data)
public static Field parseFrom ( ByteString data ) Returns Type Description Field
parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
public static Field parseFrom ( ByteString data , ExtensionRegistryLite extensionRegistry ) Returns Type Description Field
public static Field parseFrom ( CodedInputStream input ) Returns Type Description Field
public static Field parseFrom ( CodedInputStream input , ExtensionRegistryLite extensionRegistry ) Returns Type Description Field
public static Field parseFrom ( InputStream input ) Returns Type Description Field
public static Field parseFrom ( InputStream input , ExtensionRegistryLite extensionRegistry ) Returns Type Description Field
parseFrom(ByteBuffer data)
public static Field parseFrom ( ByteBuffer data ) Returns Type Description Field
parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
public static Field parseFrom ( ByteBuffer data , ExtensionRegistryLite extensionRegistry ) Returns Type Description Field
parser()
public static Parser<Field> parser () Methods dynamicMethod(GeneratedMessageLite.MethodToInvoke method, Object arg0, Object arg1)
protected final Object dynamicMethod ( GeneratedMessageLite . MethodToInvoke method , Object arg0 , Object arg1 ) A method that implements different types of operations described in MethodToInvoke . These 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.
NEW_INSTANCE returns a new instance of the protocol buffer that has not yet been made immutable. See MAKE_IMMUTABLE. IS_INITIALIZED returns null for false and the default instance for true. It doesn't use or modify any memoized value. GET_MEMOIZED_IS_INITIALIZED returns the memoized isInitialized byte value. SET_MEMOIZED_IS_INITIALIZED sets the memoized isInitialized byte value to 1 if the first parameter is not null, or to 0 if the first parameter is null. NEW_BUILDER returns a BuilderType instance. This method, plus the implementation of the Builder, enables the Builder class to be proguarded away entirely on Android.
For use by generated code only.
Returns Type Description Object
Overrides getCardinality()
public Field . Cardinality getCardinality () The field cardinality.
.google.protobuf.Field.Cardinality cardinality = 2;
getCardinalityValue()
public int getCardinalityValue () The field cardinality.
.google.protobuf.Field.Cardinality cardinality = 2;
Returns Type Description int The enum numeric value on the wire for cardinality.
getDefaultValue()
public String getDefaultValue () The string value of the default value of this field. Proto2 syntax only.
string default_value = 11;
Returns Type Description String The defaultValue.
getDefaultValueBytes()
public ByteString getDefaultValueBytes () The string value of the default value of this field. Proto2 syntax only.
string default_value = 11;
Returns Type Description ByteString The bytes for defaultValue.
getJsonName()
public String getJsonName () The field JSON name.
string json_name = 10;
Returns Type Description String The jsonName.
getJsonNameBytes()
public ByteString getJsonNameBytes () The field JSON name.
string json_name = 10;
Returns Type Description ByteString The bytes for jsonName.
getKind()
public Field . Kind getKind () The field type.
.google.protobuf.Field.Kind kind = 1;
getKindValue()
public int getKindValue () The field type.
.google.protobuf.Field.Kind kind = 1;
Returns Type Description int The enum numeric value on the wire for kind.
getName() The field name.
string name = 4;
Returns Type Description String The name.
getNameBytes()
public ByteString getNameBytes () The field name.
string name = 4;
Returns Type Description ByteString The bytes for name.
getNumber() The field number.
int32 number = 3;
Returns Type Description int The number.
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;
Returns Type Description int The oneofIndex.
getOptions(int index)
public Option getOptions ( int index ) The protocol buffer options.
repeated .google.protobuf.Option options = 9;
Parameter Name Description index int
Returns Type Description Option
getOptionsCount()
public int getOptionsCount () The protocol buffer options.
repeated .google.protobuf.Option options = 9;
Returns Type Description int
getOptionsList()
public List<Option> getOptionsList () The protocol buffer options.
repeated .google.protobuf.Option options = 9;
getOptionsOrBuilder(int index)
public OptionOrBuilder getOptionsOrBuilder ( int index ) The protocol buffer options.
repeated .google.protobuf.Option options = 9;
Parameter Name Description index int
getOptionsOrBuilderList()
public List <? extends OptionOrBuilder > getOptionsOrBuilderList () The protocol buffer options.
repeated .google.protobuf.Option options = 9;
Returns Type Description List <? extends com.google.protobuf.OptionOrBuilder >
getPacked()
public boolean getPacked () Whether to use alternative packed wire representation.
bool packed = 8;
Returns Type Description boolean The packed.
getTypeUrl()
public 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;
Returns Type Description String The typeUrl.
getTypeUrlBytes()
public 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;
Returns Type Description ByteString The bytes for typeUrl.
Send feedback
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.
Need to tell us more? [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-30 UTC."],[],[]]