Class Field.Builder (3.19.4)

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

A single field of a message type.

Protobuf type google.protobuf.Field

Implements

FieldOrBuilder

Methods

addAllOptions(Iterable<? extends Option> values)

  public 
  
 Field 
 . 
 Builder 
  
 addAllOptions 
 ( 
 Iterable 
< ? 
  
 extends 
  
 Option 
>  
 values 
 ) 
 

The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Parameter
Name
Description
values
Iterable < ? extends com.google.protobuf.Option >
Returns
Type
Description

addOptions(Option value)

  public 
  
 Field 
 . 
 Builder 
  
 addOptions 
 ( 
 Option 
  
 value 
 ) 
 

The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Parameter
Name
Description
value
Returns
Type
Description

addOptions(Option.Builder builderForValue)

  public 
  
 Field 
 . 
 Builder 
  
 addOptions 
 ( 
 Option 
 . 
 Builder 
  
 builderForValue 
 ) 
 

The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Parameter
Name
Description
builderForValue
Returns
Type
Description

addOptions(int index, Option value)

  public 
  
 Field 
 . 
 Builder 
  
 addOptions 
 ( 
 int 
  
 index 
 , 
  
 Option 
  
 value 
 ) 
 

The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Parameters
Name
Description
index
int
value
Returns
Type
Description

addOptions(int index, Option.Builder builderForValue)

  public 
  
 Field 
 . 
 Builder 
  
 addOptions 
 ( 
 int 
  
 index 
 , 
  
 Option 
 . 
 Builder 
  
 builderForValue 
 ) 
 

The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Parameters
Name
Description
index
int
builderForValue
Returns
Type
Description

clearCardinality()

  public 
  
 Field 
 . 
 Builder 
  
 clearCardinality 
 () 
 

The field cardinality.

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

Returns
Type
Description

This builder for chaining.

clearDefaultValue()

  public 
  
 Field 
 . 
 Builder 
  
 clearDefaultValue 
 () 
 

The string value of the default value of this field. Proto2 syntax only.

string default_value = 11;

Returns
Type
Description

This builder for chaining.

clearJsonName()

  public 
  
 Field 
 . 
 Builder 
  
 clearJsonName 
 () 
 

The field JSON name.

string json_name = 10;

Returns
Type
Description

This builder for chaining.

clearKind()

  public 
  
 Field 
 . 
 Builder 
  
 clearKind 
 () 
 

The field type.

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

Returns
Type
Description

This builder for chaining.

clearName()

  public 
  
 Field 
 . 
 Builder 
  
 clearName 
 () 
 

The field name.

string name = 4;

Returns
Type
Description

This builder for chaining.

clearNumber()

  public 
  
 Field 
 . 
 Builder 
  
 clearNumber 
 () 
 

The field number.

int32 number = 3;

Returns
Type
Description

This builder for chaining.

clearOneofIndex()

  public 
  
 Field 
 . 
 Builder 
  
 clearOneofIndex 
 () 
 

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

This builder for chaining.

clearOptions()

  public 
  
 Field 
 . 
 Builder 
  
 clearOptions 
 () 
 

The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Returns
Type
Description

clearPacked()

  public 
  
 Field 
 . 
 Builder 
  
 clearPacked 
 () 
 

Whether to use alternative packed wire representation.

bool packed = 8;

Returns
Type
Description

This builder for chaining.

clearTypeUrl()

  public 
  
 Field 
 . 
 Builder 
  
 clearTypeUrl 
 () 
 

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

This builder for chaining.

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 >

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.

removeOptions(int index)

  public 
  
 Field 
 . 
 Builder 
  
 removeOptions 
 ( 
 int 
  
 index 
 ) 
 

The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Parameter
Name
Description
index
int
Returns
Type
Description

setCardinality(Field.Cardinality value)

  public 
  
 Field 
 . 
 Builder 
  
 setCardinality 
 ( 
 Field 
 . 
 Cardinality 
  
 value 
 ) 
 

The field cardinality.

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

Parameter
Name
Description
value
Field.Cardinality

The enum numeric value on the wire for cardinality to set.

Returns
Type
Description

This builder for chaining.

setCardinalityValue(int value)

  public 
  
 Field 
 . 
 Builder 
  
 setCardinalityValue 
 ( 
 int 
  
 value 
 ) 
 

The field cardinality.

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

Parameter
Name
Description
value
int

The cardinality to set.

Returns
Type
Description

This builder for chaining.

setDefaultValue(String value)

  public 
  
 Field 
 . 
 Builder 
  
 setDefaultValue 
 ( 
 String 
  
 value 
 ) 
 

The string value of the default value of this field. Proto2 syntax only.

string default_value = 11;

Parameter
Name
Description
value
String

The defaultValue to set.

Returns
Type
Description

This builder for chaining.

setDefaultValueBytes(ByteString value)

  public 
  
 Field 
 . 
 Builder 
  
 setDefaultValueBytes 
 ( 
 ByteString 
  
 value 
 ) 
 

The string value of the default value of this field. Proto2 syntax only.

string default_value = 11;

Parameter
Name
Description
value
ByteString

The bytes for defaultValue to set.

Returns
Type
Description

This builder for chaining.

setJsonName(String value)

  public 
  
 Field 
 . 
 Builder 
  
 setJsonName 
 ( 
 String 
  
 value 
 ) 
 

The field JSON name.

string json_name = 10;

Parameter
Name
Description
value
String

The jsonName to set.

Returns
Type
Description

This builder for chaining.

setJsonNameBytes(ByteString value)

  public 
  
 Field 
 . 
 Builder 
  
 setJsonNameBytes 
 ( 
 ByteString 
  
 value 
 ) 
 

The field JSON name.

string json_name = 10;

Parameter
Name
Description
value
ByteString

The bytes for jsonName to set.

Returns
Type
Description

This builder for chaining.

setKind(Field.Kind value)

  public 
  
 Field 
 . 
 Builder 
  
 setKind 
 ( 
 Field 
 . 
 Kind 
  
 value 
 ) 
 

The field type.

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

Parameter
Name
Description
value
Field.Kind

The enum numeric value on the wire for kind to set.

Returns
Type
Description

This builder for chaining.

setKindValue(int value)

  public 
  
 Field 
 . 
 Builder 
  
 setKindValue 
 ( 
 int 
  
 value 
 ) 
 

The field type.

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

Parameter
Name
Description
value
int

The kind to set.

Returns
Type
Description

This builder for chaining.

setName(String value)

  public 
  
 Field 
 . 
 Builder 
  
 setName 
 ( 
 String 
  
 value 
 ) 
 

The field name.

string name = 4;

Parameter
Name
Description
value
String

The name to set.

Returns
Type
Description

This builder for chaining.

setNameBytes(ByteString value)

  public 
  
 Field 
 . 
 Builder 
  
 setNameBytes 
 ( 
 ByteString 
  
 value 
 ) 
 

The field name.

string name = 4;

Parameter
Name
Description
value
ByteString

The bytes for name to set.

Returns
Type
Description

This builder for chaining.

setNumber(int value)

  public 
  
 Field 
 . 
 Builder 
  
 setNumber 
 ( 
 int 
  
 value 
 ) 
 

The field number.

int32 number = 3;

Parameter
Name
Description
value
int

The number to set.

Returns
Type
Description

This builder for chaining.

setOneofIndex(int value)

  public 
  
 Field 
 . 
 Builder 
  
 setOneofIndex 
 ( 
 int 
  
 value 
 ) 
 

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;

Parameter
Name
Description
value
int

The oneofIndex to set.

Returns
Type
Description

This builder for chaining.

setOptions(int index, Option value)

  public 
  
 Field 
 . 
 Builder 
  
 setOptions 
 ( 
 int 
  
 index 
 , 
  
 Option 
  
 value 
 ) 
 

The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Parameters
Name
Description
index
int
value
Returns
Type
Description

setOptions(int index, Option.Builder builderForValue)

  public 
  
 Field 
 . 
 Builder 
  
 setOptions 
 ( 
 int 
  
 index 
 , 
  
 Option 
 . 
 Builder 
  
 builderForValue 
 ) 
 

The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Parameters
Name
Description
index
int
builderForValue
Returns
Type
Description

setPacked(boolean value)

  public 
  
 Field 
 . 
 Builder 
  
 setPacked 
 ( 
 boolean 
  
 value 
 ) 
 

Whether to use alternative packed wire representation.

bool packed = 8;

Parameter
Name
Description
value
boolean

The packed to set.

Returns
Type
Description

This builder for chaining.

setTypeUrl(String value)

  public 
  
 Field 
 . 
 Builder 
  
 setTypeUrl 
 ( 
 String 
  
 value 
 ) 
 

The field type URL, without the scheme, for message or enumeration types. Example: "type.googleapis.com/google.protobuf.Timestamp" .

string type_url = 6;

Parameter
Name
Description
value
String

The typeUrl to set.

Returns
Type
Description

This builder for chaining.

setTypeUrlBytes(ByteString value)

  public 
  
 Field 
 . 
 Builder 
  
 setTypeUrlBytes 
 ( 
 ByteString 
  
 value 
 ) 
 

The field type URL, without the scheme, for message or enumeration types. Example: "type.googleapis.com/google.protobuf.Timestamp" .

string type_url = 6;

Parameter
Name
Description
value
ByteString

The bytes for typeUrl to set.

Returns
Type
Description

This builder for chaining.

Design a Mobile Site
View Site in Mobile | Classic
Share by: