public static final class DescriptorProtos.FieldOptions.Builder extends GeneratedMessageV3.ExtendableBuilder<DescriptorProtos.FieldOptions,DescriptorProtos.FieldOptions.Builder> implements DescriptorProtos.FieldOptionsOrBuilder
Protobuf type google.protobuf.FieldOptions
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder<BuilderType> > GeneratedMessageV3.ExtendableBuilder > DescriptorProtos.FieldOptions.BuilderImplements
DescriptorProtos.FieldOptionsOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns | |
---|---|
Type | Description |
Descriptors.Descriptor |
Methods
<Type>addExtension(GeneratedMessage.GeneratedExtension<DescriptorProtos.FieldOptions,List<Type>> extension, Type value)
public DescriptorProtos.FieldOptions.Builder <Type>addExtension(GeneratedMessage.GeneratedExtension<DescriptorProtos.FieldOptions,List<Type>> extension, Type value)
Append a value to a repeated extension.
Parameters | |
---|---|
Name | Description |
extension | GeneratedExtension<FieldOptions,List<Type>> |
value | Type |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
<Type>clearExtension(GeneratedMessage.GeneratedExtension<DescriptorProtos.FieldOptions,?> extension)
public DescriptorProtos.FieldOptions.Builder <Type>clearExtension(GeneratedMessage.GeneratedExtension<DescriptorProtos.FieldOptions,?> extension)
Clear an extension.
Parameter | |
---|---|
Name | Description |
extension | GeneratedExtension<FieldOptions,?> |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
<Type>setExtension(GeneratedMessage.GeneratedExtension<DescriptorProtos.FieldOptions,Type> extension, Type value)
public DescriptorProtos.FieldOptions.Builder <Type>setExtension(GeneratedMessage.GeneratedExtension<DescriptorProtos.FieldOptions,Type> extension, Type value)
Set the value of an extension.
Parameters | |
---|---|
Name | Description |
extension | GeneratedExtension<FieldOptions,Type> |
value | Type |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
<Type>setExtension(GeneratedMessage.GeneratedExtension<DescriptorProtos.FieldOptions,List<Type>> extension, int index, Type value)
public DescriptorProtos.FieldOptions.Builder <Type>setExtension(GeneratedMessage.GeneratedExtension<DescriptorProtos.FieldOptions,List<Type>> extension, int index, Type value)
Set the value of one element of a repeated extension.
Parameters | |
---|---|
Name | Description |
extension | GeneratedExtension<FieldOptions,List<Type>> |
index | int |
value | Type |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
addAllUninterpretedOption(Iterable<? extends DescriptorProtos.UninterpretedOption> values)
public DescriptorProtos.FieldOptions.Builder addAllUninterpretedOption(Iterable<? extends DescriptorProtos.UninterpretedOption> values)
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Parameter | |
---|---|
Name | Description |
values | Iterable<? extends com.google.protobuf.DescriptorProtos.UninterpretedOption> |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public DescriptorProtos.FieldOptions.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field | Descriptors.FieldDescriptor |
value | Object |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
addUninterpretedOption(DescriptorProtos.UninterpretedOption value)
public DescriptorProtos.FieldOptions.Builder addUninterpretedOption(DescriptorProtos.UninterpretedOption value)
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Parameter | |
---|---|
Name | Description |
value | DescriptorProtos.UninterpretedOption |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
addUninterpretedOption(DescriptorProtos.UninterpretedOption.Builder builderForValue)
public DescriptorProtos.FieldOptions.Builder addUninterpretedOption(DescriptorProtos.UninterpretedOption.Builder builderForValue)
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Parameter | |
---|---|
Name | Description |
builderForValue | DescriptorProtos.UninterpretedOption.Builder |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
addUninterpretedOption(int index, DescriptorProtos.UninterpretedOption value)
public DescriptorProtos.FieldOptions.Builder addUninterpretedOption(int index, DescriptorProtos.UninterpretedOption value)
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Parameters | |
---|---|
Name | Description |
index | int |
value | DescriptorProtos.UninterpretedOption |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
addUninterpretedOption(int index, DescriptorProtos.UninterpretedOption.Builder builderForValue)
public DescriptorProtos.FieldOptions.Builder addUninterpretedOption(int index, DescriptorProtos.UninterpretedOption.Builder builderForValue)
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Parameters | |
---|---|
Name | Description |
index | int |
builderForValue | DescriptorProtos.UninterpretedOption.Builder |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
addUninterpretedOptionBuilder()
public DescriptorProtos.UninterpretedOption.Builder addUninterpretedOptionBuilder()
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Returns | |
---|---|
Type | Description |
DescriptorProtos.UninterpretedOption.Builder |
addUninterpretedOptionBuilder(int index)
public DescriptorProtos.UninterpretedOption.Builder addUninterpretedOptionBuilder(int index)
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Parameter | |
---|---|
Name | Description |
index | int |
Returns | |
---|---|
Type | Description |
DescriptorProtos.UninterpretedOption.Builder |
build()
public DescriptorProtos.FieldOptions build()
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions |
buildPartial()
public DescriptorProtos.FieldOptions buildPartial()
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions |
clear()
public DescriptorProtos.FieldOptions.Builder clear()
Called by the initialization and clear code paths to allow subclasses to reset any of their builtin fields back to the initial values.
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
clearCtype()
public DescriptorProtos.FieldOptions.Builder clearCtype()
The ctype option instructs the C++ code generator to use a different representation of the field than it normally would. See the specific options below. This option is not yet implemented in the open source release -- sorry, we'll try to include it in a future version!
optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder | This builder for chaining. |
clearDeprecated()
public DescriptorProtos.FieldOptions.Builder clearDeprecated()
Is this field deprecated? Depending on the target platform, this can emit Deprecated annotations for accessors, or it will be completely ignored; in the very least, this is a formalization for deprecating fields.
optional bool deprecated = 3 [default = false];
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder | This builder for chaining. |
clearField(Descriptors.FieldDescriptor field)
public DescriptorProtos.FieldOptions.Builder clearField(Descriptors.FieldDescriptor field)
Parameter | |
---|---|
Name | Description |
field | Descriptors.FieldDescriptor |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
clearJstype()
public DescriptorProtos.FieldOptions.Builder clearJstype()
The jstype option determines the JavaScript type used for values of the field. The option is permitted only for 64 bit integral and fixed types (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING is represented as JavaScript string, which avoids loss of precision that can happen when a large value is converted to a floating point JavaScript. Specifying JS_NUMBER for the jstype causes the generated JavaScript code to use the JavaScript "number" type. The behavior of the default option JS_NORMAL is implementation dependent. This option is an enum to permit additional types to be added, e.g. goog.math.Integer.
optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder | This builder for chaining. |
clearLazy()
public DescriptorProtos.FieldOptions.Builder clearLazy()
Should this field be parsed lazily? Lazy applies only to message-type fields. It means that when the outer message is initially parsed, the inner message's contents will not be parsed but instead stored in encoded form. The inner message will actually be parsed when it is first accessed. This is only a hint. Implementations are free to choose whether to use eager or lazy parsing regardless of the value of this option. However, setting this option true suggests that the protocol author believes that using lazy parsing on this field is worth the additional bookkeeping overhead typically needed to implement it. This option does not affect the public interface of any generated code; all method signatures remain the same. Furthermore, thread-safety of the interface is not affected by this option; const methods remain safe to call from multiple threads concurrently, while non-const methods continue to require exclusive access. Note that implementations may choose not to check required fields within a lazy sub-message. That is, calling IsInitialized() on the outer message may return true even if the inner message has missing required fields. This is necessary because otherwise the inner message would have to be parsed in order to perform the check, defeating the purpose of lazy parsing. An implementation which chooses not to check required fields must be consistent about it. That is, for any particular sub-message, the implementation must either always check its required fields, or never check its required fields, regardless of whether or not the message has been parsed.
optional bool lazy = 5 [default = false];
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder | This builder for chaining. |
clearOneof(Descriptors.OneofDescriptor oneof)
public DescriptorProtos.FieldOptions.Builder clearOneof(Descriptors.OneofDescriptor oneof)
TODO(jieluo): Clear it when all subclasses have implemented this method.
Parameter | |
---|---|
Name | Description |
oneof | Descriptors.OneofDescriptor |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
clearPacked()
public DescriptorProtos.FieldOptions.Builder clearPacked()
The packed option can be enabled for repeated primitive fields to enable a more efficient representation on the wire. Rather than repeatedly writing the tag and type for each element, the entire array is encoded as a single length-delimited blob. In proto3, only explicit setting it to false will avoid using packed encoding.
optional bool packed = 2;
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder | This builder for chaining. |
clearUninterpretedOption()
public DescriptorProtos.FieldOptions.Builder clearUninterpretedOption()
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
clearWeak()
public DescriptorProtos.FieldOptions.Builder clearWeak()
For Google-internal migration only. Do not use.
optional bool weak = 10 [default = false];
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder | This builder for chaining. |
clone()
public DescriptorProtos.FieldOptions.Builder clone()
Clones the Builder.
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
getCtype()
public DescriptorProtos.FieldOptions.CType getCtype()
The ctype option instructs the C++ code generator to use a different representation of the field than it normally would. See the specific options below. This option is not yet implemented in the open source release -- sorry, we'll try to include it in a future version!
optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.CType | The ctype. |
getDefaultInstanceForType()
public DescriptorProtos.FieldOptions getDefaultInstanceForType()
Get an instance of the type with no fields set. Because no fields are set, all getters for
singular fields will return default values and repeated fields will appear empty. This may or
may not be a singleton. This differs from the getDefaultInstance()
method of generated
message classes in that this method is an abstract method of the MessageLite
interface
whereas getDefaultInstance()
is a static method of a specific class. They return the
same thing.
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions |
getDeprecated()
public boolean getDeprecated()
Is this field deprecated? Depending on the target platform, this can emit Deprecated annotations for accessors, or it will be completely ignored; in the very least, this is a formalization for deprecating fields.
optional bool deprecated = 3 [default = false];
Returns | |
---|---|
Type | Description |
boolean | The deprecated. |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Get the message's type's descriptor. This differs from the getDescriptor()
method of
generated message classes in that this method is an abstract method of the Message
interface whereas getDescriptor()
is a static method of a specific class. They return
the same thing.
Returns | |
---|---|
Type | Description |
Descriptors.Descriptor |
getJstype()
public DescriptorProtos.FieldOptions.JSType getJstype()
The jstype option determines the JavaScript type used for values of the field. The option is permitted only for 64 bit integral and fixed types (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING is represented as JavaScript string, which avoids loss of precision that can happen when a large value is converted to a floating point JavaScript. Specifying JS_NUMBER for the jstype causes the generated JavaScript code to use the JavaScript "number" type. The behavior of the default option JS_NORMAL is implementation dependent. This option is an enum to permit additional types to be added, e.g. goog.math.Integer.
optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.JSType | The jstype. |
getLazy()
public boolean getLazy()
Should this field be parsed lazily? Lazy applies only to message-type fields. It means that when the outer message is initially parsed, the inner message's contents will not be parsed but instead stored in encoded form. The inner message will actually be parsed when it is first accessed. This is only a hint. Implementations are free to choose whether to use eager or lazy parsing regardless of the value of this option. However, setting this option true suggests that the protocol author believes that using lazy parsing on this field is worth the additional bookkeeping overhead typically needed to implement it. This option does not affect the public interface of any generated code; all method signatures remain the same. Furthermore, thread-safety of the interface is not affected by this option; const methods remain safe to call from multiple threads concurrently, while non-const methods continue to require exclusive access. Note that implementations may choose not to check required fields within a lazy sub-message. That is, calling IsInitialized() on the outer message may return true even if the inner message has missing required fields. This is necessary because otherwise the inner message would have to be parsed in order to perform the check, defeating the purpose of lazy parsing. An implementation which chooses not to check required fields must be consistent about it. That is, for any particular sub-message, the implementation must either always check its required fields, or never check its required fields, regardless of whether or not the message has been parsed.
optional bool lazy = 5 [default = false];
Returns | |
---|---|
Type | Description |
boolean | The lazy. |
getPacked()
public boolean getPacked()
The packed option can be enabled for repeated primitive fields to enable a more efficient representation on the wire. Rather than repeatedly writing the tag and type for each element, the entire array is encoded as a single length-delimited blob. In proto3, only explicit setting it to false will avoid using packed encoding.
optional bool packed = 2;
Returns | |
---|---|
Type | Description |
boolean | The packed. |
getUninterpretedOption(int index)
public DescriptorProtos.UninterpretedOption getUninterpretedOption(int index)
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Parameter | |
---|---|
Name | Description |
index | int |
Returns | |
---|---|
Type | Description |
DescriptorProtos.UninterpretedOption |
getUninterpretedOptionBuilder(int index)
public DescriptorProtos.UninterpretedOption.Builder getUninterpretedOptionBuilder(int index)
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Parameter | |
---|---|
Name | Description |
index | int |
Returns | |
---|---|
Type | Description |
DescriptorProtos.UninterpretedOption.Builder |
getUninterpretedOptionBuilderList()
public List<DescriptorProtos.UninterpretedOption.Builder> getUninterpretedOptionBuilderList()
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Returns | |
---|---|
Type | Description |
List<Builder> |
getUninterpretedOptionCount()
public int getUninterpretedOptionCount()
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Returns | |
---|---|
Type | Description |
int |
getUninterpretedOptionList()
public List<DescriptorProtos.UninterpretedOption> getUninterpretedOptionList()
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Returns | |
---|---|
Type | Description |
List<UninterpretedOption> |
getUninterpretedOptionOrBuilder(int index)
public DescriptorProtos.UninterpretedOptionOrBuilder getUninterpretedOptionOrBuilder(int index)
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Parameter | |
---|---|
Name | Description |
index | int |
Returns | |
---|---|
Type | Description |
DescriptorProtos.UninterpretedOptionOrBuilder |
getUninterpretedOptionOrBuilderList()
public List<? extends DescriptorProtos.UninterpretedOptionOrBuilder> getUninterpretedOptionOrBuilderList()
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Returns | |
---|---|
Type | Description |
List<? extends com.google.protobuf.DescriptorProtos.UninterpretedOptionOrBuilder> |
getWeak()
public boolean getWeak()
For Google-internal migration only. Do not use.
optional bool weak = 10 [default = false];
Returns | |
---|---|
Type | Description |
boolean | The weak. |
hasCtype()
public boolean hasCtype()
The ctype option instructs the C++ code generator to use a different representation of the field than it normally would. See the specific options below. This option is not yet implemented in the open source release -- sorry, we'll try to include it in a future version!
optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];
Returns | |
---|---|
Type | Description |
boolean | Whether the ctype field is set. |
hasDeprecated()
public boolean hasDeprecated()
Is this field deprecated? Depending on the target platform, this can emit Deprecated annotations for accessors, or it will be completely ignored; in the very least, this is a formalization for deprecating fields.
optional bool deprecated = 3 [default = false];
Returns | |
---|---|
Type | Description |
boolean | Whether the deprecated field is set. |
hasJstype()
public boolean hasJstype()
The jstype option determines the JavaScript type used for values of the field. The option is permitted only for 64 bit integral and fixed types (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING is represented as JavaScript string, which avoids loss of precision that can happen when a large value is converted to a floating point JavaScript. Specifying JS_NUMBER for the jstype causes the generated JavaScript code to use the JavaScript "number" type. The behavior of the default option JS_NORMAL is implementation dependent. This option is an enum to permit additional types to be added, e.g. goog.math.Integer.
optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];
Returns | |
---|---|
Type | Description |
boolean | Whether the jstype field is set. |
hasLazy()
public boolean hasLazy()
Should this field be parsed lazily? Lazy applies only to message-type fields. It means that when the outer message is initially parsed, the inner message's contents will not be parsed but instead stored in encoded form. The inner message will actually be parsed when it is first accessed. This is only a hint. Implementations are free to choose whether to use eager or lazy parsing regardless of the value of this option. However, setting this option true suggests that the protocol author believes that using lazy parsing on this field is worth the additional bookkeeping overhead typically needed to implement it. This option does not affect the public interface of any generated code; all method signatures remain the same. Furthermore, thread-safety of the interface is not affected by this option; const methods remain safe to call from multiple threads concurrently, while non-const methods continue to require exclusive access. Note that implementations may choose not to check required fields within a lazy sub-message. That is, calling IsInitialized() on the outer message may return true even if the inner message has missing required fields. This is necessary because otherwise the inner message would have to be parsed in order to perform the check, defeating the purpose of lazy parsing. An implementation which chooses not to check required fields must be consistent about it. That is, for any particular sub-message, the implementation must either always check its required fields, or never check its required fields, regardless of whether or not the message has been parsed.
optional bool lazy = 5 [default = false];
Returns | |
---|---|
Type | Description |
boolean | Whether the lazy field is set. |
hasPacked()
public boolean hasPacked()
The packed option can be enabled for repeated primitive fields to enable a more efficient representation on the wire. Rather than repeatedly writing the tag and type for each element, the entire array is encoded as a single length-delimited blob. In proto3, only explicit setting it to false will avoid using packed encoding.
optional bool packed = 2;
Returns | |
---|---|
Type | Description |
boolean | Whether the packed field is set. |
hasWeak()
public boolean hasWeak()
For Google-internal migration only. Do not use.
optional bool weak = 10 [default = false];
Returns | |
---|---|
Type | Description |
boolean | Whether the weak field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Get the FieldAccessorTable for this type. We can't have the message class pass this in to the constructor because of bootstrapping trouble with DescriptorProtos.
Returns | |
---|---|
Type | Description |
GeneratedMessageV3.FieldAccessorTable |
isInitialized()
public final boolean isInitialized()
Returns true if all required fields in the message and all embedded messages are set, false otherwise.
Returns | |
---|---|
Type | Description |
boolean |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public DescriptorProtos.FieldOptions.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Like Builder#mergeFrom(CodedInputStream), but also parses extensions. The extensions
that you want to be able to parse must be registered in extensionRegistry
. Extensions
not in the registry will be treated as unknown fields.
Parameters | |
---|---|
Name | Description |
input | CodedInputStream |
extensionRegistry | ExtensionRegistryLite |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
Exceptions | |
---|---|
Type | Description |
IOException |
mergeFrom(DescriptorProtos.FieldOptions other)
public DescriptorProtos.FieldOptions.Builder mergeFrom(DescriptorProtos.FieldOptions other)
Parameter | |
---|---|
Name | Description |
other | DescriptorProtos.FieldOptions |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
mergeFrom(Message other)
public DescriptorProtos.FieldOptions.Builder mergeFrom(Message other)
Merge other
into the message being built. other
must have the exact same type
as this
(i.e. getDescriptorForType() == other.getDescriptorForType()
).
Merging occurs as follows. For each field:
- For singular primitive fields, if the field is set in
other
, thenother
's value overwrites the value in this message. - For singular message fields, if the field is set in
other
, it is merged into the corresponding sub-message of this message using the same merging rules. - For repeated fields, the elements in
other
are concatenated with the elements in this message. For oneof groups, if the other message has one of the fields set, the group of this message is cleared and replaced by the field of the other message, so that the oneof constraint is preserved.
This is equivalent to the
Message::MergeFrom
method in C++.
Parameter | |
---|---|
Name | Description |
other | Message |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final DescriptorProtos.FieldOptions.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Merge some unknown fields into the UnknownFieldSet for this message.
Parameter | |
---|---|
Name | Description |
unknownFields | UnknownFieldSet |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
removeUninterpretedOption(int index)
public DescriptorProtos.FieldOptions.Builder removeUninterpretedOption(int index)
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Parameter | |
---|---|
Name | Description |
index | int |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
setCtype(DescriptorProtos.FieldOptions.CType value)
public DescriptorProtos.FieldOptions.Builder setCtype(DescriptorProtos.FieldOptions.CType value)
The ctype option instructs the C++ code generator to use a different representation of the field than it normally would. See the specific options below. This option is not yet implemented in the open source release -- sorry, we'll try to include it in a future version!
optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];
Parameter | |
---|---|
Name | Description |
value | DescriptorProtos.FieldOptions.CType The ctype to set. |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder | This builder for chaining. |
setDeprecated(boolean value)
public DescriptorProtos.FieldOptions.Builder setDeprecated(boolean value)
Is this field deprecated? Depending on the target platform, this can emit Deprecated annotations for accessors, or it will be completely ignored; in the very least, this is a formalization for deprecating fields.
optional bool deprecated = 3 [default = false];
Parameter | |
---|---|
Name | Description |
value | boolean The deprecated to set. |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder | This builder for chaining. |
setField(Descriptors.FieldDescriptor field, Object value)
public DescriptorProtos.FieldOptions.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field | Descriptors.FieldDescriptor |
value | Object |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
setJstype(DescriptorProtos.FieldOptions.JSType value)
public DescriptorProtos.FieldOptions.Builder setJstype(DescriptorProtos.FieldOptions.JSType value)
The jstype option determines the JavaScript type used for values of the field. The option is permitted only for 64 bit integral and fixed types (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING is represented as JavaScript string, which avoids loss of precision that can happen when a large value is converted to a floating point JavaScript. Specifying JS_NUMBER for the jstype causes the generated JavaScript code to use the JavaScript "number" type. The behavior of the default option JS_NORMAL is implementation dependent. This option is an enum to permit additional types to be added, e.g. goog.math.Integer.
optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];
Parameter | |
---|---|
Name | Description |
value | DescriptorProtos.FieldOptions.JSType The jstype to set. |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder | This builder for chaining. |
setLazy(boolean value)
public DescriptorProtos.FieldOptions.Builder setLazy(boolean value)
Should this field be parsed lazily? Lazy applies only to message-type fields. It means that when the outer message is initially parsed, the inner message's contents will not be parsed but instead stored in encoded form. The inner message will actually be parsed when it is first accessed. This is only a hint. Implementations are free to choose whether to use eager or lazy parsing regardless of the value of this option. However, setting this option true suggests that the protocol author believes that using lazy parsing on this field is worth the additional bookkeeping overhead typically needed to implement it. This option does not affect the public interface of any generated code; all method signatures remain the same. Furthermore, thread-safety of the interface is not affected by this option; const methods remain safe to call from multiple threads concurrently, while non-const methods continue to require exclusive access. Note that implementations may choose not to check required fields within a lazy sub-message. That is, calling IsInitialized() on the outer message may return true even if the inner message has missing required fields. This is necessary because otherwise the inner message would have to be parsed in order to perform the check, defeating the purpose of lazy parsing. An implementation which chooses not to check required fields must be consistent about it. That is, for any particular sub-message, the implementation must either always check its required fields, or never check its required fields, regardless of whether or not the message has been parsed.
optional bool lazy = 5 [default = false];
Parameter | |
---|---|
Name | Description |
value | boolean The lazy to set. |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder | This builder for chaining. |
setPacked(boolean value)
public DescriptorProtos.FieldOptions.Builder setPacked(boolean value)
The packed option can be enabled for repeated primitive fields to enable a more efficient representation on the wire. Rather than repeatedly writing the tag and type for each element, the entire array is encoded as a single length-delimited blob. In proto3, only explicit setting it to false will avoid using packed encoding.
optional bool packed = 2;
Parameter | |
---|---|
Name | Description |
value | boolean The packed to set. |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder | This builder for chaining. |
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public DescriptorProtos.FieldOptions.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters | |
---|---|
Name | Description |
field | Descriptors.FieldDescriptor |
index | int |
value | Object |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
setUninterpretedOption(int index, DescriptorProtos.UninterpretedOption value)
public DescriptorProtos.FieldOptions.Builder setUninterpretedOption(int index, DescriptorProtos.UninterpretedOption value)
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Parameters | |
---|---|
Name | Description |
index | int |
value | DescriptorProtos.UninterpretedOption |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
setUninterpretedOption(int index, DescriptorProtos.UninterpretedOption.Builder builderForValue)
public DescriptorProtos.FieldOptions.Builder setUninterpretedOption(int index, DescriptorProtos.UninterpretedOption.Builder builderForValue)
The parser stores options it doesn't recognize here. See above.
repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;
Parameters | |
---|---|
Name | Description |
index | int |
builderForValue | DescriptorProtos.UninterpretedOption.Builder |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
setUnknownFields(UnknownFieldSet unknownFields)
public final DescriptorProtos.FieldOptions.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields | UnknownFieldSet |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder |
setWeak(boolean value)
public DescriptorProtos.FieldOptions.Builder setWeak(boolean value)
For Google-internal migration only. Do not use.
optional bool weak = 10 [default = false];
Parameter | |
---|---|
Name | Description |
value | boolean The weak to set. |
Returns | |
---|---|
Type | Description |
DescriptorProtos.FieldOptions.Builder | This builder for chaining. |