public static final class Field.Builder extends GeneratedMessageLite.Builder<Field,Field.Builder> implements FieldOrBuilderA single field of a message type.
 Protobuf type google.protobuf.Field
Inheritance
java.lang.Object > AbstractMessageLite.Builder<MessageType,BuilderType> > GeneratedMessageLite.Builder > Field.BuilderImplements
FieldOrBuilderMethods
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 | 
| Field.Builder | |
addOptions(Option value)
public Field.Builder addOptions(Option value)The protocol buffer options.
 repeated .google.protobuf.Option options = 9;
| Parameter | |
|---|---|
| Name | Description | 
| value | Option | 
| Returns | |
|---|---|
| Type | Description | 
| Field.Builder | |
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 | Option.Builder | 
| Returns | |
|---|---|
| Type | Description | 
| 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 | |
|---|---|
| Name | Description | 
| index | int | 
| value | Option | 
| Returns | |
|---|---|
| Type | Description | 
| 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 | |
|---|---|
| Name | Description | 
| index | int | 
| builderForValue | Option.Builder | 
| Returns | |
|---|---|
| Type | Description | 
| Field.Builder | |
clearCardinality()
public Field.Builder clearCardinality()The field cardinality.
 .google.protobuf.Field.Cardinality cardinality = 2;
| Returns | |
|---|---|
| Type | Description | 
| 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 | |
|---|---|
| Type | Description | 
| Field.Builder | This builder for chaining. | 
clearJsonName()
public Field.Builder clearJsonName()The field JSON name.
 string json_name = 10;
| Returns | |
|---|---|
| Type | Description | 
| Field.Builder | This builder for chaining. | 
clearKind()
public Field.Builder clearKind()The field type.
 .google.protobuf.Field.Kind kind = 1;
| Returns | |
|---|---|
| Type | Description | 
| Field.Builder | This builder for chaining. | 
clearName()
public Field.Builder clearName()The field name.
 string name = 4;
| Returns | |
|---|---|
| Type | Description | 
| Field.Builder | This builder for chaining. | 
clearNumber()
public Field.Builder clearNumber()The field number.
 int32 number = 3;
| Returns | |
|---|---|
| Type | Description | 
| 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 | |
|---|---|
| Type | Description | 
| Field.Builder | This builder for chaining. | 
clearOptions()
public Field.Builder clearOptions()The protocol buffer options.
 repeated .google.protobuf.Option options = 9;
| Returns | |
|---|---|
| Type | Description | 
| Field.Builder | |
clearPacked()
public Field.Builder clearPacked()Whether to use alternative packed wire representation.
 bool packed = 8;
| Returns | |
|---|---|
| Type | Description | 
| 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 | |
|---|---|
| Type | Description | 
| Field.Builder | This builder for chaining. | 
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> | |
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. | 
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 | 
| Field.Builder | |
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.CardinalityThe enum numeric value on the wire for cardinality to set. | 
| Returns | |
|---|---|
| Type | Description | 
| 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 | |
|---|---|
| Name | Description | 
| value | intThe cardinality to set. | 
| Returns | |
|---|---|
| Type | Description | 
| 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 | |
|---|---|
| Name | Description | 
| value | StringThe defaultValue to set. | 
| Returns | |
|---|---|
| Type | Description | 
| 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 | |
|---|---|
| Name | Description | 
| value | ByteStringThe bytes for defaultValue to set. | 
| Returns | |
|---|---|
| Type | Description | 
| Field.Builder | 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 | StringThe jsonName to set. | 
| Returns | |
|---|---|
| Type | Description | 
| Field.Builder | 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 | ByteStringThe bytes for jsonName to set. | 
| Returns | |
|---|---|
| Type | Description | 
| 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 | |
|---|---|
| Name | Description | 
| value | Field.KindThe enum numeric value on the wire for kind to set. | 
| Returns | |
|---|---|
| Type | Description | 
| 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 | |
|---|---|
| Name | Description | 
| value | intThe kind to set. | 
| Returns | |
|---|---|
| Type | Description | 
| Field.Builder | This builder for chaining. | 
setName(String value)
public Field.Builder setName(String value)The field name.
 string name = 4;
| Parameter | |
|---|---|
| Name | Description | 
| value | StringThe name to set. | 
| Returns | |
|---|---|
| Type | Description | 
| Field.Builder | This builder for chaining. | 
setNameBytes(ByteString value)
public Field.Builder setNameBytes(ByteString value)The field name.
 string name = 4;
| Parameter | |
|---|---|
| Name | Description | 
| value | ByteStringThe bytes for name to set. | 
| Returns | |
|---|---|
| Type | Description | 
| Field.Builder | This builder for chaining. | 
setNumber(int value)
public Field.Builder setNumber(int value)The field number.
 int32 number = 3;
| Parameter | |
|---|---|
| Name | Description | 
| value | intThe number to set. | 
| Returns | |
|---|---|
| Type | Description | 
| 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 | |
|---|---|
| Name | Description | 
| value | intThe oneofIndex to set. | 
| Returns | |
|---|---|
| Type | Description | 
| 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 | |
|---|---|
| Name | Description | 
| index | int | 
| value | Option | 
| Returns | |
|---|---|
| Type | Description | 
| 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 | |
|---|---|
| Name | Description | 
| index | int | 
| builderForValue | Option.Builder | 
| Returns | |
|---|---|
| Type | Description | 
| Field.Builder | |
setPacked(boolean value)
public Field.Builder setPacked(boolean value)Whether to use alternative packed wire representation.
 bool packed = 8;
| Parameter | |
|---|---|
| Name | Description | 
| value | booleanThe packed to set. | 
| Returns | |
|---|---|
| Type | Description | 
| 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 | |
|---|---|
| Name | Description | 
| value | StringThe typeUrl to set. | 
| Returns | |
|---|---|
| Type | Description | 
| 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 | |
|---|---|
| Name | Description | 
| value | ByteStringThe bytes for typeUrl to set. | 
| Returns | |
|---|---|
| Type | Description | 
| Field.Builder | This builder for chaining. |