public static final class Type.Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder> implements TypeOrBuilder
A protocol buffer message type.Protobuf type
google.protobuf.Type| Modifier and Type | Method and Description |
|---|---|
Type.Builder |
addAllFields(java.lang.Iterable<? extends Field> values)
The list of fields.
|
Type.Builder |
addAllOneofs(java.lang.Iterable<java.lang.String> values)
The list of types appearing in `oneof` definitions in this type.
|
Type.Builder |
addAllOptions(java.lang.Iterable<? extends Option> values)
The protocol buffer options.
|
Type.Builder |
addFields(Field.Builder builderForValue)
The list of fields.
|
Type.Builder |
addFields(Field value)
The list of fields.
|
Type.Builder |
addFields(int index,
Field.Builder builderForValue)
The list of fields.
|
Type.Builder |
addFields(int index,
Field value)
The list of fields.
|
Field.Builder |
addFieldsBuilder()
The list of fields.
|
Field.Builder |
addFieldsBuilder(int index)
The list of fields.
|
Type.Builder |
addOneofs(java.lang.String value)
The list of types appearing in `oneof` definitions in this type.
|
Type.Builder |
addOneofsBytes(ByteString value)
The list of types appearing in `oneof` definitions in this type.
|
Type.Builder |
addOptions(int index,
Option.Builder builderForValue)
The protocol buffer options.
|
Type.Builder |
addOptions(int index,
Option value)
The protocol buffer options.
|
Type.Builder |
addOptions(Option.Builder builderForValue)
The protocol buffer options.
|
Type.Builder |
addOptions(Option value)
The protocol buffer options.
|
Option.Builder |
addOptionsBuilder()
The protocol buffer options.
|
Option.Builder |
addOptionsBuilder(int index)
The protocol buffer options.
|
Type.Builder |
addRepeatedField(Descriptors.FieldDescriptor field,
java.lang.Object value)
Like
setRepeatedField, but appends the value as a new element. |
Type |
build()
Constructs the message based on the state of the Builder.
|
Type |
buildPartial()
Like
MessageLite.Builder.build(), but does not throw an exception if the message is missing required
fields. |
Type.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.
|
Type.Builder |
clearField(Descriptors.FieldDescriptor field)
Clears the field.
|
Type.Builder |
clearFields()
The list of fields.
|
Type.Builder |
clearName()
The fully qualified message name.
|
Type.Builder |
clearOneof(Descriptors.OneofDescriptor oneof)
|
Type.Builder |
clearOneofs()
The list of types appearing in `oneof` definitions in this type.
|
Type.Builder |
clearOptions()
The protocol buffer options.
|
Type.Builder |
clearSourceContext()
The source context.
|
Type.Builder |
clearSyntax()
The source syntax.
|
Type.Builder |
clone()
Clones the Builder.
|
Type |
getDefaultInstanceForType()
Get an instance of the type with no fields set.
|
static Descriptors.Descriptor |
getDescriptor() |
Descriptors.Descriptor |
getDescriptorForType()
Get the message's type's descriptor.
|
Field |
getFields(int index)
The list of fields.
|
Field.Builder |
getFieldsBuilder(int index)
The list of fields.
|
java.util.List<Field.Builder> |
getFieldsBuilderList()
The list of fields.
|
int |
getFieldsCount()
The list of fields.
|
java.util.List<Field> |
getFieldsList()
The list of fields.
|
FieldOrBuilder |
getFieldsOrBuilder(int index)
The list of fields.
|
java.util.List<? extends FieldOrBuilder> |
getFieldsOrBuilderList()
The list of fields.
|
java.lang.String |
getName()
The fully qualified message name.
|
ByteString |
getNameBytes()
The fully qualified message name.
|
java.lang.String |
getOneofs(int index)
The list of types appearing in `oneof` definitions in this type.
|
ByteString |
getOneofsBytes(int index)
The list of types appearing in `oneof` definitions in this type.
|
int |
getOneofsCount()
The list of types appearing in `oneof` definitions in this type.
|
ProtocolStringList |
getOneofsList()
The list of types appearing in `oneof` definitions in this type.
|
Option |
getOptions(int index)
The protocol buffer options.
|
Option.Builder |
getOptionsBuilder(int index)
The protocol buffer options.
|
java.util.List<Option.Builder> |
getOptionsBuilderList()
The protocol buffer options.
|
int |
getOptionsCount()
The protocol buffer options.
|
java.util.List<Option> |
getOptionsList()
The protocol buffer options.
|
OptionOrBuilder |
getOptionsOrBuilder(int index)
The protocol buffer options.
|
java.util.List<? extends OptionOrBuilder> |
getOptionsOrBuilderList()
The protocol buffer options.
|
SourceContext |
getSourceContext()
The source context.
|
SourceContext.Builder |
getSourceContextBuilder()
The source context.
|
SourceContextOrBuilder |
getSourceContextOrBuilder()
The source context.
|
Syntax |
getSyntax()
The source syntax.
|
int |
getSyntaxValue()
The source syntax.
|
boolean |
hasSourceContext()
The source context.
|
boolean |
isInitialized()
Returns true if all required fields in the message and all embedded messages are set, false
otherwise.
|
Type.Builder |
mergeFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry)
Like
MessageLite.Builder.mergeFrom(CodedInputStream), but also parses extensions. |
Type.Builder |
mergeFrom(Message other)
Merge
other into the message being built. |
Type.Builder |
mergeFrom(Type other) |
Type.Builder |
mergeSourceContext(SourceContext value)
The source context.
|
Type.Builder |
mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
Merge some unknown fields into the
UnknownFieldSet for this message. |
Type.Builder |
removeFields(int index)
The list of fields.
|
Type.Builder |
removeOptions(int index)
The protocol buffer options.
|
Type.Builder |
setField(Descriptors.FieldDescriptor field,
java.lang.Object value)
Sets a field to the given value.
|
Type.Builder |
setFields(int index,
Field.Builder builderForValue)
The list of fields.
|
Type.Builder |
setFields(int index,
Field value)
The list of fields.
|
Type.Builder |
setName(java.lang.String value)
The fully qualified message name.
|
Type.Builder |
setNameBytes(ByteString value)
The fully qualified message name.
|
Type.Builder |
setOneofs(int index,
java.lang.String value)
The list of types appearing in `oneof` definitions in this type.
|
Type.Builder |
setOptions(int index,
Option.Builder builderForValue)
The protocol buffer options.
|
Type.Builder |
setOptions(int index,
Option value)
The protocol buffer options.
|
Type.Builder |
setRepeatedField(Descriptors.FieldDescriptor field,
int index,
java.lang.Object value)
Sets an element of a repeated field to the given value.
|
Type.Builder |
setSourceContext(SourceContext.Builder builderForValue)
The source context.
|
Type.Builder |
setSourceContext(SourceContext value)
The source context.
|
Type.Builder |
setSyntax(Syntax value)
The source syntax.
|
Type.Builder |
setSyntaxValue(int value)
The source syntax.
|
Type.Builder |
setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
Set the
UnknownFieldSet for this message. |
getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, newBuilderForFieldfindInitializationErrors, getInitializationErrorString, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, toStringmergeFromequals, getClass, hashCode, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneofmergeFrompublic static final Descriptors.Descriptor getDescriptor()
public Type.Builder clear()
com.google.protobuf.GeneratedMessageV3.Builderclear in interface Message.Builderclear in interface MessageLite.Builderclear in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>public Descriptors.Descriptor getDescriptorForType()
Message.BuilderMessageOrBuilder.getDescriptorForType().getDescriptorForType in interface Message.BuildergetDescriptorForType in interface MessageOrBuildergetDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>public Type getDefaultInstanceForType()
MessageLiteOrBuildergetDefaultInstance() 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.getDefaultInstanceForType in interface MessageLiteOrBuildergetDefaultInstanceForType in interface MessageOrBuilderpublic Type build()
MessageLite.Builderbuild in interface Message.Builderbuild in interface MessageLite.Builderpublic Type buildPartial()
MessageLite.BuilderMessageLite.Builder.build(), but does not throw an exception if the message is missing required
fields. Instead, a partial message is returned. Subsequent changes to the Builder will not
affect the returned message.buildPartial in interface Message.BuilderbuildPartial in interface MessageLite.Builderpublic Type.Builder clone()
MessageLite.Builderclone in interface Message.Builderclone in interface MessageLite.Builderclone in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>Object.clone()public Type.Builder setField(Descriptors.FieldDescriptor field, java.lang.Object value)
Message.BuilderMessageOrBuilder.getField(Descriptors.FieldDescriptor) would return.setField in interface Message.BuildersetField in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>public Type.Builder clearField(Descriptors.FieldDescriptor field)
Message.BuilderclearField in interface Message.BuilderclearField in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>public Type.Builder clearOneof(Descriptors.OneofDescriptor oneof)
AbstractMessage.BuilderclearOneof in interface Message.BuilderclearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>public Type.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, java.lang.Object value)
Message.BuilderMessageOrBuilder.getRepeatedField(Descriptors.FieldDescriptor,int) would return.setRepeatedField in interface Message.BuildersetRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>public Type.Builder addRepeatedField(Descriptors.FieldDescriptor field, java.lang.Object value)
Message.BuildersetRepeatedField, but appends the value as a new element.addRepeatedField in interface Message.BuilderaddRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>public Type.Builder mergeFrom(Message other)
Message.Builderother 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, then other'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++.
mergeFrom in interface Message.BuildermergeFrom in class AbstractMessage.Builder<Type.Builder>public Type.Builder mergeFrom(Type other)
public final boolean isInitialized()
MessageLiteOrBuilderisInitialized in interface MessageLiteOrBuilderisInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>public Type.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
MessageLite.BuilderMessageLite.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.mergeFrom in interface Message.BuildermergeFrom in interface MessageLite.BuildermergeFrom in class AbstractMessage.Builder<Type.Builder>java.io.IOExceptionpublic java.lang.String getName()
The fully qualified message name.
string name = 1;getName in interface TypeOrBuilderpublic ByteString getNameBytes()
The fully qualified message name.
string name = 1;getNameBytes in interface TypeOrBuilderpublic Type.Builder setName(java.lang.String value)
The fully qualified message name.
string name = 1;value - The name to set.public Type.Builder clearName()
The fully qualified message name.
string name = 1;public Type.Builder setNameBytes(ByteString value)
The fully qualified message name.
string name = 1;value - The bytes for name to set.public java.util.List<Field> getFieldsList()
The list of fields.
repeated .google.protobuf.Field fields = 2;getFieldsList in interface TypeOrBuilderpublic int getFieldsCount()
The list of fields.
repeated .google.protobuf.Field fields = 2;getFieldsCount in interface TypeOrBuilderpublic Field getFields(int index)
The list of fields.
repeated .google.protobuf.Field fields = 2;getFields in interface TypeOrBuilderpublic Type.Builder setFields(int index, Field value)
The list of fields.
repeated .google.protobuf.Field fields = 2;public Type.Builder setFields(int index, Field.Builder builderForValue)
The list of fields.
repeated .google.protobuf.Field fields = 2;public Type.Builder addFields(Field value)
The list of fields.
repeated .google.protobuf.Field fields = 2;public Type.Builder addFields(int index, Field value)
The list of fields.
repeated .google.protobuf.Field fields = 2;public Type.Builder addFields(Field.Builder builderForValue)
The list of fields.
repeated .google.protobuf.Field fields = 2;public Type.Builder addFields(int index, Field.Builder builderForValue)
The list of fields.
repeated .google.protobuf.Field fields = 2;public Type.Builder addAllFields(java.lang.Iterable<? extends Field> values)
The list of fields.
repeated .google.protobuf.Field fields = 2;public Type.Builder clearFields()
The list of fields.
repeated .google.protobuf.Field fields = 2;public Type.Builder removeFields(int index)
The list of fields.
repeated .google.protobuf.Field fields = 2;public Field.Builder getFieldsBuilder(int index)
The list of fields.
repeated .google.protobuf.Field fields = 2;public FieldOrBuilder getFieldsOrBuilder(int index)
The list of fields.
repeated .google.protobuf.Field fields = 2;getFieldsOrBuilder in interface TypeOrBuilderpublic java.util.List<? extends FieldOrBuilder> getFieldsOrBuilderList()
The list of fields.
repeated .google.protobuf.Field fields = 2;getFieldsOrBuilderList in interface TypeOrBuilderpublic Field.Builder addFieldsBuilder()
The list of fields.
repeated .google.protobuf.Field fields = 2;public Field.Builder addFieldsBuilder(int index)
The list of fields.
repeated .google.protobuf.Field fields = 2;public java.util.List<Field.Builder> getFieldsBuilderList()
The list of fields.
repeated .google.protobuf.Field fields = 2;public ProtocolStringList getOneofsList()
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;getOneofsList in interface TypeOrBuilderpublic int getOneofsCount()
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;getOneofsCount in interface TypeOrBuilderpublic java.lang.String getOneofs(int index)
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;getOneofs in interface TypeOrBuilderindex - The index of the element to return.public ByteString getOneofsBytes(int index)
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;getOneofsBytes in interface TypeOrBuilderindex - The index of the value to return.public Type.Builder setOneofs(int index, java.lang.String value)
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;index - The index to set the value at.value - The oneofs to set.public Type.Builder addOneofs(java.lang.String value)
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;value - The oneofs to add.public Type.Builder addAllOneofs(java.lang.Iterable<java.lang.String> values)
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;values - The oneofs to add.public Type.Builder clearOneofs()
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;public Type.Builder addOneofsBytes(ByteString value)
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;value - The bytes of the oneofs to add.public java.util.List<Option> getOptionsList()
The protocol buffer options.
repeated .google.protobuf.Option options = 4;getOptionsList in interface TypeOrBuilderpublic int getOptionsCount()
The protocol buffer options.
repeated .google.protobuf.Option options = 4;getOptionsCount in interface TypeOrBuilderpublic Option getOptions(int index)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;getOptions in interface TypeOrBuilderpublic Type.Builder setOptions(int index, Option value)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;public Type.Builder setOptions(int index, Option.Builder builderForValue)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;public Type.Builder addOptions(Option value)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;public Type.Builder addOptions(int index, Option value)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;public Type.Builder addOptions(Option.Builder builderForValue)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;public Type.Builder addOptions(int index, Option.Builder builderForValue)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;public Type.Builder addAllOptions(java.lang.Iterable<? extends Option> values)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;public Type.Builder clearOptions()
The protocol buffer options.
repeated .google.protobuf.Option options = 4;public Type.Builder removeOptions(int index)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;public Option.Builder getOptionsBuilder(int index)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;public OptionOrBuilder getOptionsOrBuilder(int index)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;getOptionsOrBuilder in interface TypeOrBuilderpublic java.util.List<? extends OptionOrBuilder> getOptionsOrBuilderList()
The protocol buffer options.
repeated .google.protobuf.Option options = 4;getOptionsOrBuilderList in interface TypeOrBuilderpublic Option.Builder addOptionsBuilder()
The protocol buffer options.
repeated .google.protobuf.Option options = 4;public Option.Builder addOptionsBuilder(int index)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;public java.util.List<Option.Builder> getOptionsBuilderList()
The protocol buffer options.
repeated .google.protobuf.Option options = 4;public boolean hasSourceContext()
The source context.
.google.protobuf.SourceContext source_context = 5;hasSourceContext in interface TypeOrBuilderpublic SourceContext getSourceContext()
The source context.
.google.protobuf.SourceContext source_context = 5;getSourceContext in interface TypeOrBuilderpublic Type.Builder setSourceContext(SourceContext value)
The source context.
.google.protobuf.SourceContext source_context = 5;public Type.Builder setSourceContext(SourceContext.Builder builderForValue)
The source context.
.google.protobuf.SourceContext source_context = 5;public Type.Builder mergeSourceContext(SourceContext value)
The source context.
.google.protobuf.SourceContext source_context = 5;public Type.Builder clearSourceContext()
The source context.
.google.protobuf.SourceContext source_context = 5;public SourceContext.Builder getSourceContextBuilder()
The source context.
.google.protobuf.SourceContext source_context = 5;public SourceContextOrBuilder getSourceContextOrBuilder()
The source context.
.google.protobuf.SourceContext source_context = 5;getSourceContextOrBuilder in interface TypeOrBuilderpublic int getSyntaxValue()
The source syntax.
.google.protobuf.Syntax syntax = 6;getSyntaxValue in interface TypeOrBuilderpublic Type.Builder setSyntaxValue(int value)
The source syntax.
.google.protobuf.Syntax syntax = 6;value - The enum numeric value on the wire for syntax to set.public Syntax getSyntax()
The source syntax.
.google.protobuf.Syntax syntax = 6;getSyntax in interface TypeOrBuilderpublic Type.Builder setSyntax(Syntax value)
The source syntax.
.google.protobuf.Syntax syntax = 6;value - The syntax to set.public Type.Builder clearSyntax()
The source syntax.
.google.protobuf.Syntax syntax = 6;public final Type.Builder setUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
Message.BuilderUnknownFieldSet for this message.setUnknownFields in interface Message.BuildersetUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>public final Type.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
Message.BuilderUnknownFieldSet for this message.mergeUnknownFields in interface Message.BuildermergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>