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, newBuilderForField
findInitializationErrors, getInitializationErrorString, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, toString
mergeFrom
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
mergeFrom
public static final Descriptors.Descriptor getDescriptor()
public Type.Builder clear()
com.google.protobuf.GeneratedMessageV3.Builder
clear
in interface Message.Builder
clear
in interface MessageLite.Builder
clear
in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>
public Descriptors.Descriptor getDescriptorForType()
Message.Builder
MessageOrBuilder.getDescriptorForType()
.getDescriptorForType
in interface Message.Builder
getDescriptorForType
in interface MessageOrBuilder
getDescriptorForType
in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>
public Type getDefaultInstanceForType()
MessageLiteOrBuilder
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.getDefaultInstanceForType
in interface MessageLiteOrBuilder
getDefaultInstanceForType
in interface MessageOrBuilder
public Type build()
MessageLite.Builder
build
in interface Message.Builder
build
in interface MessageLite.Builder
public Type buildPartial()
MessageLite.Builder
MessageLite.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.Builder
buildPartial
in interface MessageLite.Builder
public Type.Builder clone()
MessageLite.Builder
clone
in interface Message.Builder
clone
in interface MessageLite.Builder
clone
in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>
Object.clone()
public Type.Builder setField(Descriptors.FieldDescriptor field, java.lang.Object value)
Message.Builder
MessageOrBuilder.getField(Descriptors.FieldDescriptor)
would return.setField
in interface Message.Builder
setField
in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>
public Type.Builder clearField(Descriptors.FieldDescriptor field)
Message.Builder
clearField
in interface Message.Builder
clearField
in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>
public Type.Builder clearOneof(Descriptors.OneofDescriptor oneof)
AbstractMessage.Builder
clearOneof
in interface Message.Builder
clearOneof
in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>
public Type.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, java.lang.Object value)
Message.Builder
MessageOrBuilder.getRepeatedField(Descriptors.FieldDescriptor,int)
would return.setRepeatedField
in interface Message.Builder
setRepeatedField
in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>
public Type.Builder addRepeatedField(Descriptors.FieldDescriptor field, java.lang.Object value)
Message.Builder
setRepeatedField
, but appends the value as a new element.addRepeatedField
in interface Message.Builder
addRepeatedField
in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>
public Type.Builder mergeFrom(Message other)
Message.Builder
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
, 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.Builder
mergeFrom
in class AbstractMessage.Builder<Type.Builder>
public Type.Builder mergeFrom(Type other)
public final boolean isInitialized()
MessageLiteOrBuilder
isInitialized
in interface MessageLiteOrBuilder
isInitialized
in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>
public Type.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
MessageLite.Builder
MessageLite.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.Builder
mergeFrom
in interface MessageLite.Builder
mergeFrom
in class AbstractMessage.Builder<Type.Builder>
java.io.IOException
public java.lang.String getName()
The fully qualified message name.
string name = 1;
getName
in interface TypeOrBuilder
public ByteString getNameBytes()
The fully qualified message name.
string name = 1;
getNameBytes
in interface TypeOrBuilder
public 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 TypeOrBuilder
public int getFieldsCount()
The list of fields.
repeated .google.protobuf.Field fields = 2;
getFieldsCount
in interface TypeOrBuilder
public Field getFields(int index)
The list of fields.
repeated .google.protobuf.Field fields = 2;
getFields
in interface TypeOrBuilder
public 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 TypeOrBuilder
public java.util.List<? extends FieldOrBuilder> getFieldsOrBuilderList()
The list of fields.
repeated .google.protobuf.Field fields = 2;
getFieldsOrBuilderList
in interface TypeOrBuilder
public 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 TypeOrBuilder
public int getOneofsCount()
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;
getOneofsCount
in interface TypeOrBuilder
public java.lang.String getOneofs(int index)
The list of types appearing in `oneof` definitions in this type.
repeated string oneofs = 3;
getOneofs
in interface TypeOrBuilder
index
- 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 TypeOrBuilder
index
- 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 TypeOrBuilder
public int getOptionsCount()
The protocol buffer options.
repeated .google.protobuf.Option options = 4;
getOptionsCount
in interface TypeOrBuilder
public Option getOptions(int index)
The protocol buffer options.
repeated .google.protobuf.Option options = 4;
getOptions
in interface TypeOrBuilder
public 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 TypeOrBuilder
public java.util.List<? extends OptionOrBuilder> getOptionsOrBuilderList()
The protocol buffer options.
repeated .google.protobuf.Option options = 4;
getOptionsOrBuilderList
in interface TypeOrBuilder
public 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 TypeOrBuilder
public SourceContext getSourceContext()
The source context.
.google.protobuf.SourceContext source_context = 5;
getSourceContext
in interface TypeOrBuilder
public 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 TypeOrBuilder
public int getSyntaxValue()
The source syntax.
.google.protobuf.Syntax syntax = 6;
getSyntaxValue
in interface TypeOrBuilder
public 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 TypeOrBuilder
public 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.Builder
UnknownFieldSet
for this message.setUnknownFields
in interface Message.Builder
setUnknownFields
in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>
public final Type.Builder mergeUnknownFields(com.google.protobuf.UnknownFieldSet unknownFields)
Message.Builder
UnknownFieldSet
for this message.mergeUnknownFields
in interface Message.Builder
mergeUnknownFields
in class com.google.protobuf.GeneratedMessageV3.Builder<Type.Builder>