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

newBuilder()

  public 
  
 static 
  
 Field 
 . 
 Builder 
  
 newBuilder 
 () 
 
Returns
Type
Description

newBuilder(Field prototype)

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

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

  public 
  
 static 
  
 Parser<Field> 
  
 parser 
 () 
 
Returns
Type
Description

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
arg0
arg1
Returns
Type
Description
Overrides

getCardinality()

  public 
  
 Field 
 . 
 Cardinality 
  
 getCardinality 
 () 
 

The field cardinality.

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

Returns
Type
Description

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

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

The bytes for defaultValue.

getJsonName()

  public 
  
 String 
  
 getJsonName 
 () 
 

The field JSON name.

string json_name = 10;

Returns
Type
Description

The jsonName.

getJsonNameBytes()

  public 
  
 ByteString 
  
 getJsonNameBytes 
 () 
 

The field JSON name.

string json_name = 10;

Returns
Type
Description

The bytes for jsonName.

getKind()

  public 
  
 Field 
 . 
 Kind 
  
 getKind 
 () 
 

The field type.

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

Returns
Type
Description

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

The name.

getNameBytes()

  public 
  
 ByteString 
  
 getNameBytes 
 () 
 

The field name.

string name = 4;

Returns
Type
Description

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

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

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

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

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

The bytes for typeUrl.

Create a Mobile Website
View Site in Mobile | Classic
Share by: