Package com.google.protobuf
Class Field.Builder
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite.Builder<MessageType,BuilderType>
-
- com.google.protobuf.GeneratedMessageLite.Builder<Field,Field.Builder>
-
- com.google.protobuf.Field.Builder
-
- All Implemented Interfaces:
FieldOrBuilder
,MessageLite.Builder
,MessageLiteOrBuilder
,java.lang.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 typegoogle.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, isBuilt
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Field.Builder
addAllOptions(java.lang.Iterable<? extends Option> values)
The protocol buffer options.Field.Builder
addOptions(int index, Option value)
The protocol buffer options.Field.Builder
addOptions(int index, Option.Builder builderForValue)
The protocol buffer options.Field.Builder
addOptions(Option value)
The protocol buffer options.Field.Builder
addOptions(Option.Builder builderForValue)
The protocol buffer options.Field.Builder
clearCardinality()
The field cardinality.Field.Builder
clearDefaultValue()
The string value of the default value of this field.Field.Builder
clearJsonName()
The field JSON name.Field.Builder
clearKind()
The field type.Field.Builder
clearName()
The field name.Field.Builder
clearNumber()
The field number.Field.Builder
clearOneofIndex()
The index of the field type in `Type.oneofs`, for message or enumeration types.Field.Builder
clearOptions()
The protocol buffer options.Field.Builder
clearPacked()
Whether to use alternative packed wire representation.Field.Builder
clearTypeUrl()
The field type URL, without the scheme, for message or enumeration types.Field.Cardinality
getCardinality()
The field cardinality.int
getCardinalityValue()
The field cardinality.java.lang.String
getDefaultValue()
The string value of the default value of this field.ByteString
getDefaultValueBytes()
The string value of the default value of this field.java.lang.String
getJsonName()
The field JSON name.ByteString
getJsonNameBytes()
The field JSON name.Field.Kind
getKind()
The field type.int
getKindValue()
The field type.java.lang.String
getName()
The field name.ByteString
getNameBytes()
The field name.int
getNumber()
The field number.int
getOneofIndex()
The index of the field type in `Type.oneofs`, for message or enumeration types.Option
getOptions(int index)
The protocol buffer options.int
getOptionsCount()
The protocol buffer options.java.util.List<Option>
getOptionsList()
The protocol buffer options.boolean
getPacked()
Whether to use alternative packed wire representation.java.lang.String
getTypeUrl()
The field type URL, without the scheme, for message or enumeration types.ByteString
getTypeUrlBytes()
The field type URL, without the scheme, for message or enumeration types.Field.Builder
removeOptions(int index)
The protocol buffer options.Field.Builder
setCardinality(Field.Cardinality value)
The field cardinality.Field.Builder
setCardinalityValue(int value)
The field cardinality.Field.Builder
setDefaultValue(java.lang.String value)
The string value of the default value of this field.Field.Builder
setDefaultValueBytes(ByteString value)
The string value of the default value of this field.Field.Builder
setJsonName(java.lang.String value)
The field JSON name.Field.Builder
setJsonNameBytes(ByteString value)
The field JSON name.Field.Builder
setKind(Field.Kind value)
The field type.Field.Builder
setKindValue(int value)
The field type.Field.Builder
setName(java.lang.String value)
The field name.Field.Builder
setNameBytes(ByteString value)
The field name.Field.Builder
setNumber(int value)
The field number.Field.Builder
setOneofIndex(int value)
The index of the field type in `Type.oneofs`, for message or enumeration types.Field.Builder
setOptions(int index, Option value)
The protocol buffer options.Field.Builder
setOptions(int index, Option.Builder builderForValue)
The protocol buffer options.Field.Builder
setPacked(boolean value)
Whether to use alternative packed wire representation.Field.Builder
setTypeUrl(java.lang.String value)
The field type URL, without the scheme, for message or enumeration types.Field.Builder
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
-
-
-
-
Method Detail
-
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
public Field.Builder setKindValue(int value)
The field type.
.google.protobuf.Field.Kind kind = 1;
- Parameters:
value
- The kind to set.- Returns:
- This builder for chaining.
-
getKind
public Field.Kind getKind()
The field type.
.google.protobuf.Field.Kind kind = 1;
- Specified by:
getKind
in interfaceFieldOrBuilder
- Returns:
- The kind.
-
setKind
public Field.Builder setKind(Field.Kind value)
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
public Field.Builder 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
public Field.Builder setCardinalityValue(int value)
The field cardinality.
.google.protobuf.Field.Cardinality cardinality = 2;
- Parameters:
value
- The cardinality to set.- Returns:
- This builder for chaining.
-
getCardinality
public Field.Cardinality getCardinality()
The field cardinality.
.google.protobuf.Field.Cardinality cardinality = 2;
- Specified by:
getCardinality
in interfaceFieldOrBuilder
- Returns:
- The cardinality.
-
setCardinality
public Field.Builder setCardinality(Field.Cardinality value)
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
public Field.Builder 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
public Field.Builder setNumber(int value)
The field number.
int32 number = 3;
- Parameters:
value
- The number to set.- Returns:
- This builder for chaining.
-
clearNumber
public Field.Builder clearNumber()
The field number.
int32 number = 3;
- Returns:
- This builder for chaining.
-
getName
public java.lang.String getName()
The field name.
string name = 4;
- Specified by:
getName
in interfaceFieldOrBuilder
- Returns:
- The name.
-
getNameBytes
public ByteString getNameBytes()
The field name.
string name = 4;
- Specified by:
getNameBytes
in interfaceFieldOrBuilder
- Returns:
- The bytes for name.
-
setName
public Field.Builder setName(java.lang.String value)
The field name.
string name = 4;
- Parameters:
value
- The name to set.- Returns:
- This builder for chaining.
-
clearName
public Field.Builder clearName()
The field name.
string name = 4;
- Returns:
- This builder for chaining.
-
setNameBytes
public Field.Builder setNameBytes(ByteString value)
The field name.
string name = 4;
- Parameters:
value
- The bytes for name to set.- Returns:
- This builder for chaining.
-
getTypeUrl
public java.lang.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;
- Specified by:
getTypeUrl
in interfaceFieldOrBuilder
- Returns:
- 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;
- Specified by:
getTypeUrlBytes
in interfaceFieldOrBuilder
- Returns:
- The bytes for typeUrl.
-
setTypeUrl
public Field.Builder setTypeUrl(java.lang.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;
- Parameters:
value
- The typeUrl to set.- Returns:
- 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:
- This builder for chaining.
-
setTypeUrlBytes
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;
- 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
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;
- Parameters:
value
- The oneofIndex to set.- Returns:
- 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:
- 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
public Field.Builder setPacked(boolean value)
Whether to use alternative packed wire representation.
bool packed = 8;
- Parameters:
value
- The packed to set.- Returns:
- This builder for chaining.
-
clearPacked
public Field.Builder clearPacked()
Whether to use alternative packed wire representation.
bool packed = 8;
- Returns:
- This builder for chaining.
-
getOptionsList
public java.util.List<Option> 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
public Option getOptions(int index)
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
- Specified by:
getOptions
in interfaceFieldOrBuilder
-
setOptions
public Field.Builder setOptions(int index, Option value)
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
setOptions
public Field.Builder setOptions(int index, Option.Builder builderForValue)
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
addOptions
public Field.Builder addOptions(Option value)
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
addOptions
public Field.Builder addOptions(int index, Option value)
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
addOptions
public Field.Builder addOptions(Option.Builder builderForValue)
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
addOptions
public Field.Builder addOptions(int index, Option.Builder builderForValue)
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
addAllOptions
public Field.Builder addAllOptions(java.lang.Iterable<? extends Option> values)
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
clearOptions
public Field.Builder clearOptions()
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
removeOptions
public Field.Builder removeOptions(int index)
The protocol buffer options.
repeated .google.protobuf.Option options = 9;
-
getJsonName
public java.lang.String getJsonName()
The field JSON name.
string json_name = 10;
- Specified by:
getJsonName
in interfaceFieldOrBuilder
- Returns:
- The jsonName.
-
getJsonNameBytes
public ByteString getJsonNameBytes()
The field JSON name.
string json_name = 10;
- Specified by:
getJsonNameBytes
in interfaceFieldOrBuilder
- Returns:
- The bytes for jsonName.
-
setJsonName
public Field.Builder setJsonName(java.lang.String value)
The field JSON name.
string json_name = 10;
- Parameters:
value
- The jsonName to set.- Returns:
- This builder for chaining.
-
clearJsonName
public Field.Builder clearJsonName()
The field JSON name.
string json_name = 10;
- Returns:
- This builder for chaining.
-
setJsonNameBytes
public Field.Builder setJsonNameBytes(ByteString value)
The field JSON name.
string json_name = 10;
- Parameters:
value
- The bytes for jsonName to set.- Returns:
- This builder for chaining.
-
getDefaultValue
public java.lang.String 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
public ByteString 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
public Field.Builder setDefaultValue(java.lang.String value)
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
public Field.Builder clearDefaultValue()
The string value of the default value of this field. Proto2 syntax only.
string default_value = 11;
- Returns:
- This builder for chaining.
-
setDefaultValueBytes
public Field.Builder setDefaultValueBytes(ByteString value)
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.
-
-