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
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()
Returns
Type Description
Field.Builder

newBuilder(Field prototype)

public static Field.Builder newBuilder(Field prototype)
Parameter
Name Description
prototype Field
Returns
Type Description
Field.Builder

parseDelimitedFrom(InputStream input)

public static Field parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Field
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Field parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Field
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Field parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Field
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Field parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Field
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Field parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Field
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Field parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Field
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Field parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Field
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Field parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Field
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Field parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Field
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Field parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Field
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Field parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Field
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Field parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Field
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Field> parser()
Returns
Type Description
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
Name Description
method GeneratedMessageLite.MethodToInvoke
arg0 Object
arg1 Object
Returns
Type Description
Object
Overrides

getCardinality()

public Field.Cardinality getCardinality()

The field cardinality.

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

Returns
Type Description
Field.Cardinality

The cardinality.

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;

Returns
Type Description
Field.Kind

The kind.

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()

public String 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()

public int 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;

Returns
Type Description
List<Option>

getOptionsOrBuilder(int index)

public OptionOrBuilder getOptionsOrBuilder(int index)

The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Parameter
Name Description
index int
Returns
Type Description
OptionOrBuilder

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.