Package com.google.protobuf
Class Field.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder<Field,Field.Builder>
com.google.protobuf.GeneratedMessageLite.Builder<Field,Field.Builder>
com.google.protobuf.Field.Builder
- All Implemented Interfaces:
FieldOrBuilder
,MessageLite.Builder
,MessageLiteOrBuilder
,Cloneable
- Enclosing class:
Field
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
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite.Builder
AbstractMessageLite.Builder.LimitedInputStream
-
Field Summary
Fields inherited from class com.google.protobuf.GeneratedMessageLite.Builder
instance
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAllOptions
(Iterable<? extends Option> values) The protocol buffer options.addOptions
(int index, Option value) The protocol buffer options.addOptions
(int index, Option.Builder builderForValue) The protocol buffer options.addOptions
(Option value) The protocol buffer options.addOptions
(Option.Builder builderForValue) The protocol buffer options.The field cardinality.The string value of the default value of this field.The field JSON name.The field type.The field name.The field number.The index of the field type in `Type.oneofs`, for message or enumeration types.The protocol buffer options.Whether to use alternative packed wire representation.The field type URL, without the scheme, for message or enumeration types.The field cardinality.int
The field cardinality.The string value of the default value of this field.The string value of the default value of this field.The field JSON name.The field JSON name.getKind()
The field type.int
The field type.getName()
The field name.The field name.int
The field number.int
The index of the field type in `Type.oneofs`, for message or enumeration types.getOptions
(int index) The protocol buffer options.int
The protocol buffer options.The protocol buffer options.boolean
Whether to use alternative packed wire representation.The field type URL, without the scheme, for message or enumeration types.The field type URL, without the scheme, for message or enumeration types.removeOptions
(int index) The protocol buffer options.setCardinality
(Field.Cardinality value) The field cardinality.setCardinalityValue
(int value) The field cardinality.setDefaultValue
(String value) The string value of the default value of this field.setDefaultValueBytes
(ByteString value) The string value of the default value of this field.setJsonName
(String value) The field JSON name.setJsonNameBytes
(ByteString value) The field JSON name.setKind
(Field.Kind value) The field type.setKindValue
(int value) The field type.The field name.setNameBytes
(ByteString value) The field name.setNumber
(int value) The field number.setOneofIndex
(int value) The index of the field type in `Type.oneofs`, for message or enumeration types.setOptions
(int index, Option value) The protocol buffer options.setOptions
(int index, Option.Builder builderForValue) The protocol buffer options.setPacked
(boolean value) Whether to use alternative packed wire representation.setTypeUrl
(String value) The field type URL, without the scheme, for message or enumeration types.setTypeUrlBytes
(ByteString value) The field type URL, without the scheme, for message or enumeration types.Methods inherited from class com.google.protobuf.GeneratedMessageLite.Builder
build, buildPartial, clear, clone, copyOnWrite, copyOnWriteInternal, getDefaultInstanceForType, internalMergeFrom, isInitialized, mergeFrom, mergeFrom, mergeFrom, mergeFrom
Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.protobuf.MessageLiteOrBuilder
getDefaultInstanceForType, isInitialized
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
getKindValue
public int getKindValue()The field type.
.google.protobuf.Field.Kind kind = 1;
- Specified by:
getKindValue
in interfaceFieldOrBuilder
- Returns:
- The enum numeric value on the wire for kind.
-
setKindValue
The field type.
.google.protobuf.Field.Kind kind = 1;
- Parameters:
value
- The kind to set.- Returns:
- This builder for chaining.
-
getKind
The field type.
.google.protobuf.Field.Kind kind = 1;
- Specified by:
getKind
in interfaceFieldOrBuilder
- Returns:
- The kind.
-
setKind
The field type.
.google.protobuf.Field.Kind kind = 1;
- Parameters:
value
- The enum numeric value on the wire for kind to set.- Returns:
- This builder for chaining.
-
clearKind
The field type.
.google.protobuf.Field.Kind kind = 1;
- Returns:
- This builder for chaining.
-
getCardinalityValue
public int getCardinalityValue()The field cardinality.
.google.protobuf.Field.Cardinality cardinality = 2;
- Specified by:
getCardinalityValue
in interfaceFieldOrBuilder
- Returns:
- The enum numeric value on the wire for cardinality.
-
setCardinalityValue
The field cardinality.
.google.protobuf.Field.Cardinality cardinality = 2;
- Parameters:
value
- The cardinality to set.- Returns:
- This builder for chaining.
-
getCardinality
The field cardinality.
.google.protobuf.Field.Cardinality cardinality = 2;
- Specified by:
getCardinality
in interfaceFieldOrBuilder
- Returns:
- The cardinality.
-
setCardinality
The field cardinality.
.google.protobuf.Field.Cardinality cardinality = 2;
- Parameters:
value
- The enum numeric value on the wire for cardinality to set.- Returns:
- This builder for chaining.
-
clearCardinality
The field cardinality.
.google.protobuf.Field.Cardinality cardinality = 2;
- Returns:
- This builder for chaining.
-
getNumber
public int getNumber()The field number.
int32 number = 3;
- Specified by:
getNumber
in interfaceFieldOrBuilder
- Returns:
- The number.
-
setNumber
The field number.
int32 number = 3;
- Parameters:
value
- The number to set.- Returns:
- This builder for chaining.
-
clearNumber
The field number.
int32 number = 3;
- Returns:
- This builder for chaining.
-
getName
The field name.
string name = 4;
- Specified by:
getName
in interfaceFieldOrBuilder
- Returns:
- The name.
-
getNameBytes
The field name.
string name = 4;
- Specified by:
getNameBytes
in interfaceFieldOrBuilder
- Returns:
- The bytes for name.
-
setName
The field name.
string name = 4;
- Parameters:
value
- The name to set.- Returns:
- This builder for chaining.
-
clearName
The field name.
string name = 4;
- Returns:
- This builder for chaining.
-
setNameBytes
The field name.
string name = 4;
- Parameters:
value
- The bytes for name to set.- Returns:
- This builder for chaining.
-
getTypeUrl
The field type URL, without the scheme, for message or enumeration types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
string type_url = 6;
- Specified by:
getTypeUrl
in interfaceFieldOrBuilder
- Returns:
- The typeUrl.
-
getTypeUrlBytes
The field type URL, without the scheme, for message or enumeration types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
string type_url = 6;
- Specified by:
getTypeUrlBytes
in interfaceFieldOrBuilder
- Returns:
- The bytes for typeUrl.
-
setTypeUrl
The field type URL, without the scheme, for message or enumeration types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
string type_url = 6;
- Parameters:
value
- The typeUrl to set.- Returns:
- This builder for chaining.
-
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:
- This builder for chaining.
-
setTypeUrlBytes
The field type URL, without the scheme, for message or enumeration types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
string type_url = 6;
- Parameters:
value
- The bytes for typeUrl to set.- Returns:
- This builder for chaining.
-
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;
- Specified by:
getOneofIndex
in interfaceFieldOrBuilder
- Returns:
- The oneofIndex.
-
setOneofIndex
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;
- Parameters:
value
- The oneofIndex to set.- Returns:
- This builder for chaining.
-
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:
- This builder for chaining.
-
getPacked
public boolean getPacked()Whether to use alternative packed wire representation.
bool packed = 8;
- Specified by:
getPacked
in interfaceFieldOrBuilder
- Returns:
- The packed.
-
setPacked
Whether to use alternative packed wire representation.
bool packed = 8;
- Parameters:
value
- The packed to set.- Returns:
- This builder for chaining.
-
clearPacked
Whether to use alternative packed wire representation.
bool packed = 8;
- Returns:
- This builder for chaining.
-
getOptionsList
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
- Specified by:
getOptionsList
in interfaceFieldOrBuilder
-
getOptionsCount
public int getOptionsCount()The protocol buffer options.
repeated .google.protobuf.Option options = 9;
- Specified by:
getOptionsCount
in interfaceFieldOrBuilder
-
getOptions
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
- Specified by:
getOptions
in interfaceFieldOrBuilder
-
setOptions
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
setOptions
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
addOptions
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
addOptions
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
addOptions
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
addOptions
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
addAllOptions
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
clearOptions
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
removeOptions
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
getJsonName
The field JSON name.
string json_name = 10;
- Specified by:
getJsonName
in interfaceFieldOrBuilder
- Returns:
- The jsonName.
-
getJsonNameBytes
The field JSON name.
string json_name = 10;
- Specified by:
getJsonNameBytes
in interfaceFieldOrBuilder
- Returns:
- The bytes for jsonName.
-
setJsonName
The field JSON name.
string json_name = 10;
- Parameters:
value
- The jsonName to set.- Returns:
- This builder for chaining.
-
clearJsonName
The field JSON name.
string json_name = 10;
- Returns:
- This builder for chaining.
-
setJsonNameBytes
The field JSON name.
string json_name = 10;
- Parameters:
value
- The bytes for jsonName to set.- Returns:
- This builder for chaining.
-
getDefaultValue
The string value of the default value of this field. Proto2 syntax only.
string default_value = 11;
- Specified by:
getDefaultValue
in interfaceFieldOrBuilder
- Returns:
- The defaultValue.
-
getDefaultValueBytes
The string value of the default value of this field. Proto2 syntax only.
string default_value = 11;
- Specified by:
getDefaultValueBytes
in interfaceFieldOrBuilder
- Returns:
- The bytes for defaultValue.
-
setDefaultValue
The string value of the default value of this field. Proto2 syntax only.
string default_value = 11;
- Parameters:
value
- The defaultValue to set.- Returns:
- This builder for chaining.
-
clearDefaultValue
The string value of the default value of this field. Proto2 syntax only.
string default_value = 11;
- Returns:
- This builder for chaining.
-
setDefaultValueBytes
The string value of the default value of this field. Proto2 syntax only.
string default_value = 11;
- Parameters:
value
- The bytes for defaultValue to set.- Returns:
- This builder for chaining.
-