Class Field (3.19.4)

public final class Field extends GeneratedMessageLite<Field,Field.Builder> implements FieldOrBuilder

A single field of a message type.

Protobuf type google.protobuf.Field

Implements

FieldOrBuilder

Static Fields

CARDINALITY_FIELD_NUMBER

public static final int CARDINALITY_FIELD_NUMBER
Field Value
TypeDescription
int

DEFAULT_VALUE_FIELD_NUMBER

public static final int DEFAULT_VALUE_FIELD_NUMBER
Field Value
TypeDescription
int

JSON_NAME_FIELD_NUMBER

public static final int JSON_NAME_FIELD_NUMBER
Field Value
TypeDescription
int

KIND_FIELD_NUMBER

public static final int KIND_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

NUMBER_FIELD_NUMBER

public static final int NUMBER_FIELD_NUMBER
Field Value
TypeDescription
int

ONEOF_INDEX_FIELD_NUMBER

public static final int ONEOF_INDEX_FIELD_NUMBER
Field Value
TypeDescription
int

OPTIONS_FIELD_NUMBER

public static final int OPTIONS_FIELD_NUMBER
Field Value
TypeDescription
int

PACKED_FIELD_NUMBER

public static final int PACKED_FIELD_NUMBER
Field Value
TypeDescription
int

TYPE_URL_FIELD_NUMBER

public static final int TYPE_URL_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Field getDefaultInstance()
Returns
TypeDescription
Field

newBuilder()

public static Field.Builder newBuilder()
Returns
TypeDescription
Field.Builder

newBuilder(Field prototype)

public static Field.Builder newBuilder(Field prototype)
Parameter
NameDescription
prototypeField
Returns
TypeDescription
Field.Builder

parseDelimitedFrom(InputStream input)

public static Field parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Field
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Field parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Field
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Field parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Field
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Field parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Field
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Field parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Field
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Field parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Field
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Field parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Field
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Field parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Field
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Field parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Field
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Field parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Field
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Field parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Field
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Field parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Field
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Field> parser()
Returns
TypeDescription
Parser<Field>

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.

Parameters
NameDescription
methodGeneratedMessageLite.MethodToInvoke
arg0Object
arg1Object
Returns
TypeDescription
Object
Overrides

getCardinality()

public Field.Cardinality getCardinality()

The field cardinality.

.google.protobuf.Field.Cardinality cardinality = 2;

Returns
TypeDescription
Field.Cardinality

The cardinality.

getCardinalityValue()

public int getCardinalityValue()

The field cardinality.

.google.protobuf.Field.Cardinality cardinality = 2;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for defaultValue.

getJsonName()

public String getJsonName()

The field JSON name.

string json_name = 10;

Returns
TypeDescription
String

The jsonName.

getJsonNameBytes()

public ByteString getJsonNameBytes()

The field JSON name.

string json_name = 10;

Returns
TypeDescription
ByteString

The bytes for jsonName.

getKind()

public Field.Kind getKind()

The field type.

.google.protobuf.Field.Kind kind = 1;

Returns
TypeDescription
Field.Kind

The kind.

getKindValue()

public int getKindValue()

The field type.

.google.protobuf.Field.Kind kind = 1;

Returns
TypeDescription
int

The enum numeric value on the wire for kind.

getName()

public String getName()

The field name.

string name = 4;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

The field name.

string name = 4;

Returns
TypeDescription
ByteString

The bytes for name.

getNumber()

public int getNumber()

The field number.

int32 number = 3;

Returns
TypeDescription
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
TypeDescription
int

The oneofIndex.

getOptions(int index)

public Option getOptions(int index)

The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Parameter
NameDescription
indexint
Returns
TypeDescription
Option

getOptionsCount()

public int getOptionsCount()

The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Returns
TypeDescription
int

getOptionsList()

public List<Option> getOptionsList()

The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Returns
TypeDescription
List<Option>

getOptionsOrBuilder(int index)

public OptionOrBuilder getOptionsOrBuilder(int index)

The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Parameter
NameDescription
indexint
Returns
TypeDescription
OptionOrBuilder

getOptionsOrBuilderList()

public List<? extends OptionOrBuilder> getOptionsOrBuilderList()

The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Returns
TypeDescription
List<? extends com.google.protobuf.OptionOrBuilder>

getPacked()

public boolean getPacked()

Whether to use alternative packed wire representation.

bool packed = 8;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for typeUrl.