Class Field.Builder

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
NameDescription
valuesIterable<? extends com.google.protobuf.Option>
Returns
TypeDescription
Field.Builder

addOptions(Option value)

public Field.Builder addOptions(Option value)


The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Parameter
NameDescription
valueOption
Returns
TypeDescription
Field.Builder

addOptions(Option.Builder builderForValue)

public Field.Builder addOptions(Option.Builder builderForValue)


The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Parameter
NameDescription
builderForValueOption.Builder
Returns
TypeDescription
Field.Builder

addOptions(int index, Option value)

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


The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Parameters
NameDescription
indexint
valueOption
Returns
TypeDescription
Field.Builder

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
NameDescription
indexint
builderForValueOption.Builder
Returns
TypeDescription
Field.Builder

clearCardinality()

public Field.Builder clearCardinality()


The field cardinality.

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

Returns
TypeDescription
Field.Builder

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
TypeDescription
Field.Builder

This builder for chaining.

clearJsonName()

public Field.Builder clearJsonName()


The field JSON name.

string json_name = 10;

Returns
TypeDescription
Field.Builder

This builder for chaining.

clearKind()

public Field.Builder clearKind()


The field type.

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

Returns
TypeDescription
Field.Builder

This builder for chaining.

clearName()

public Field.Builder clearName()


The field name.

string name = 4;

Returns
TypeDescription
Field.Builder

This builder for chaining.

clearNumber()

public Field.Builder clearNumber()


The field number.

int32 number = 3;

Returns
TypeDescription
Field.Builder

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
TypeDescription
Field.Builder

This builder for chaining.

clearOptions()

public Field.Builder clearOptions()


The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Returns
TypeDescription
Field.Builder

clearPacked()

public Field.Builder clearPacked()


Whether to use alternative packed wire representation.

bool packed = 8;

Returns
TypeDescription
Field.Builder

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
TypeDescription
Field.Builder

This builder for chaining.

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>

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.

removeOptions(int index)

public Field.Builder removeOptions(int index)


The protocol buffer options.

repeated .google.protobuf.Option options = 9;

Parameter
NameDescription
indexint
Returns
TypeDescription
Field.Builder

setCardinality(Field.Cardinality value)

public Field.Builder setCardinality(Field.Cardinality value)


The field cardinality.

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

Parameter
NameDescription
valueField.Cardinality

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

Returns
TypeDescription
Field.Builder

This builder for chaining.

setCardinalityValue(int value)

public Field.Builder setCardinalityValue(int value)


The field cardinality.

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

Parameter
NameDescription
valueint

The cardinality to set.

Returns
TypeDescription
Field.Builder

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
NameDescription
valueString

The defaultValue to set.

Returns
TypeDescription
Field.Builder

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
NameDescription
valueByteString

The bytes for defaultValue to set.

Returns
TypeDescription
Field.Builder

This builder for chaining.

setJsonName(String value)

public Field.Builder setJsonName(String value)


The field JSON name.

string json_name = 10;

Parameter
NameDescription
valueString

The jsonName to set.

Returns
TypeDescription
Field.Builder

This builder for chaining.

setJsonNameBytes(ByteString value)

public Field.Builder setJsonNameBytes(ByteString value)


The field JSON name.

string json_name = 10;

Parameter
NameDescription
valueByteString

The bytes for jsonName to set.

Returns
TypeDescription
Field.Builder

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
NameDescription
valueField.Kind

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

Returns
TypeDescription
Field.Builder

This builder for chaining.

setKindValue(int value)

public Field.Builder setKindValue(int value)


The field type.

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

Parameter
NameDescription
valueint

The kind to set.

Returns
TypeDescription
Field.Builder

This builder for chaining.

setName(String value)

public Field.Builder setName(String value)


The field name.

string name = 4;

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
Field.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Field.Builder setNameBytes(ByteString value)


The field name.

string name = 4;

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
Field.Builder

This builder for chaining.

setNumber(int value)

public Field.Builder setNumber(int value)


The field number.

int32 number = 3;

Parameter
NameDescription
valueint

The number to set.

Returns
TypeDescription
Field.Builder

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
NameDescription
valueint

The oneofIndex to set.

Returns
TypeDescription
Field.Builder

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
NameDescription
indexint
valueOption
Returns
TypeDescription
Field.Builder

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
NameDescription
indexint
builderForValueOption.Builder
Returns
TypeDescription
Field.Builder

setPacked(boolean value)

public Field.Builder setPacked(boolean value)


Whether to use alternative packed wire representation.

bool packed = 8;

Parameter
NameDescription
valueboolean

The packed to set.

Returns
TypeDescription
Field.Builder

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
NameDescription
valueString

The typeUrl to set.

Returns
TypeDescription
Field.Builder

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
NameDescription
valueByteString

The bytes for typeUrl to set.

Returns
TypeDescription
Field.Builder

This builder for chaining.