public static final class Type.Builder extends GeneratedMessage.Builder<Type.Builder> implements TypeOrBuilder
google.protobuf.Type
A light-weight descriptor for a proto message type.
| Modifier and Type | Method and Description |
|---|---|
Type.Builder |
addAllFields(java.lang.Iterable<? extends Field> values)
repeated .google.protobuf.Field fields = 2; |
Type.Builder |
addAllOneofs(java.lang.Iterable<java.lang.String> values)
repeated string oneofs = 3; |
Type.Builder |
addAllOptions(java.lang.Iterable<? extends Option> values)
repeated .google.protobuf.Option options = 4; |
Type.Builder |
addFields(Field.Builder builderForValue)
repeated .google.protobuf.Field fields = 2; |
Type.Builder |
addFields(Field value)
repeated .google.protobuf.Field fields = 2; |
Type.Builder |
addFields(int index,
Field.Builder builderForValue)
repeated .google.protobuf.Field fields = 2; |
Type.Builder |
addFields(int index,
Field value)
repeated .google.protobuf.Field fields = 2; |
Field.Builder |
addFieldsBuilder()
repeated .google.protobuf.Field fields = 2; |
Field.Builder |
addFieldsBuilder(int index)
repeated .google.protobuf.Field fields = 2; |
Type.Builder |
addOneofs(java.lang.String value)
repeated string oneofs = 3; |
Type.Builder |
addOneofsBytes(ByteString value)
repeated string oneofs = 3; |
Type.Builder |
addOptions(int index,
Option.Builder builderForValue)
repeated .google.protobuf.Option options = 4; |
Type.Builder |
addOptions(int index,
Option value)
repeated .google.protobuf.Option options = 4; |
Type.Builder |
addOptions(Option.Builder builderForValue)
repeated .google.protobuf.Option options = 4; |
Type.Builder |
addOptions(Option value)
repeated .google.protobuf.Option options = 4; |
Option.Builder |
addOptionsBuilder()
repeated .google.protobuf.Option options = 4; |
Option.Builder |
addOptionsBuilder(int index)
repeated .google.protobuf.Option options = 4; |
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 |
clearFields()
repeated .google.protobuf.Field fields = 2; |
Type.Builder |
clearName()
optional string name = 1; |
Type.Builder |
clearOneofs()
repeated string oneofs = 3; |
Type.Builder |
clearOptions()
repeated .google.protobuf.Option options = 4; |
Type.Builder |
clearSourceContext()
optional .google.protobuf.SourceContext source_context = 5; |
Type.Builder |
clearSyntax()
optional .google.protobuf.Syntax syntax = 6; |
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)
repeated .google.protobuf.Field fields = 2; |
Field.Builder |
getFieldsBuilder(int index)
repeated .google.protobuf.Field fields = 2; |
java.util.List<Field.Builder> |
getFieldsBuilderList()
repeated .google.protobuf.Field fields = 2; |
int |
getFieldsCount()
repeated .google.protobuf.Field fields = 2; |
java.util.List<Field> |
getFieldsList()
repeated .google.protobuf.Field fields = 2; |
FieldOrBuilder |
getFieldsOrBuilder(int index)
repeated .google.protobuf.Field fields = 2; |
java.util.List<? extends FieldOrBuilder> |
getFieldsOrBuilderList()
repeated .google.protobuf.Field fields = 2; |
java.lang.String |
getName()
optional string name = 1; |
ByteString |
getNameBytes()
optional string name = 1; |
java.lang.String |
getOneofs(int index)
repeated string oneofs = 3; |
ByteString |
getOneofsBytes(int index)
repeated string oneofs = 3; |
int |
getOneofsCount()
repeated string oneofs = 3; |
ProtocolStringList |
getOneofsList()
repeated string oneofs = 3; |
Option |
getOptions(int index)
repeated .google.protobuf.Option options = 4; |
Option.Builder |
getOptionsBuilder(int index)
repeated .google.protobuf.Option options = 4; |
java.util.List<Option.Builder> |
getOptionsBuilderList()
repeated .google.protobuf.Option options = 4; |
int |
getOptionsCount()
repeated .google.protobuf.Option options = 4; |
java.util.List<Option> |
getOptionsList()
repeated .google.protobuf.Option options = 4; |
OptionOrBuilder |
getOptionsOrBuilder(int index)
repeated .google.protobuf.Option options = 4; |
java.util.List<? extends OptionOrBuilder> |
getOptionsOrBuilderList()
repeated .google.protobuf.Option options = 4; |
SourceContext |
getSourceContext()
optional .google.protobuf.SourceContext source_context = 5; |
SourceContext.Builder |
getSourceContextBuilder()
optional .google.protobuf.SourceContext source_context = 5; |
SourceContextOrBuilder |
getSourceContextOrBuilder()
optional .google.protobuf.SourceContext source_context = 5; |
Syntax |
getSyntax()
optional .google.protobuf.Syntax syntax = 6; |
int |
getSyntaxValue()
optional .google.protobuf.Syntax syntax = 6; |
boolean |
hasSourceContext()
optional .google.protobuf.SourceContext source_context = 5; |
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)
optional .google.protobuf.SourceContext source_context = 5; |
Type.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
Merge some unknown fields into the
UnknownFieldSet for this
message. |
Type.Builder |
removeFields(int index)
repeated .google.protobuf.Field fields = 2; |
Type.Builder |
removeOptions(int index)
repeated .google.protobuf.Option options = 4; |
Type.Builder |
setFields(int index,
Field.Builder builderForValue)
repeated .google.protobuf.Field fields = 2; |
Type.Builder |
setFields(int index,
Field value)
repeated .google.protobuf.Field fields = 2; |
Type.Builder |
setName(java.lang.String value)
optional string name = 1; |
Type.Builder |
setNameBytes(ByteString value)
optional string name = 1; |
Type.Builder |
setOneofs(int index,
java.lang.String value)
repeated string oneofs = 3; |
Type.Builder |
setOptions(int index,
Option.Builder builderForValue)
repeated .google.protobuf.Option options = 4; |
Type.Builder |
setOptions(int index,
Option value)
repeated .google.protobuf.Option options = 4; |
Type.Builder |
setSourceContext(SourceContext.Builder builderForValue)
optional .google.protobuf.SourceContext source_context = 5; |
Type.Builder |
setSourceContext(SourceContext value)
optional .google.protobuf.SourceContext source_context = 5; |
Type.Builder |
setSyntax(Syntax value)
optional .google.protobuf.Syntax syntax = 6; |
Type.Builder |
setSyntaxValue(int value)
optional .google.protobuf.Syntax syntax = 6; |
Type.Builder |
setUnknownFields(UnknownFieldSet unknownFields)
Set the
UnknownFieldSet for this message. |
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, newBuilderForField, setField, setRepeatedFieldfindInitializationErrors, getInitializationErrorString, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneofpublic static final Descriptors.Descriptor getDescriptor()
public Type.Builder clear()
GeneratedMessage.Builderclear in interface Message.Builderclear in interface MessageLite.Builderclear in class GeneratedMessage.Builder<Type.Builder>public Descriptors.Descriptor getDescriptorForType()
Message.BuilderMessageOrBuilder.getDescriptorForType().getDescriptorForType in interface Message.BuildergetDescriptorForType in interface MessageOrBuildergetDescriptorForType in class GeneratedMessage.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 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:other,
then other's value overwrites the value in this message.other,
it is merged into the corresponding sub-message of this message
using the same merging rules.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 GeneratedMessage.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()
optional string name = 1;
The fully qualified message name.
getName in interface TypeOrBuilderpublic ByteString getNameBytes()
optional string name = 1;
The fully qualified message name.
getNameBytes in interface TypeOrBuilderpublic Type.Builder setName(java.lang.String value)
optional string name = 1;
The fully qualified message name.
public Type.Builder clearName()
optional string name = 1;
The fully qualified message name.
public Type.Builder setNameBytes(ByteString value)
optional string name = 1;
The fully qualified message name.
public java.util.List<Field> getFieldsList()
repeated .google.protobuf.Field fields = 2;
The list of fields.
getFieldsList in interface TypeOrBuilderpublic int getFieldsCount()
repeated .google.protobuf.Field fields = 2;
The list of fields.
getFieldsCount in interface TypeOrBuilderpublic Field getFields(int index)
repeated .google.protobuf.Field fields = 2;
The list of fields.
getFields in interface TypeOrBuilderpublic Type.Builder setFields(int index, Field value)
repeated .google.protobuf.Field fields = 2;
The list of fields.
public Type.Builder setFields(int index, Field.Builder builderForValue)
repeated .google.protobuf.Field fields = 2;
The list of fields.
public Type.Builder addFields(Field value)
repeated .google.protobuf.Field fields = 2;
The list of fields.
public Type.Builder addFields(int index, Field value)
repeated .google.protobuf.Field fields = 2;
The list of fields.
public Type.Builder addFields(Field.Builder builderForValue)
repeated .google.protobuf.Field fields = 2;
The list of fields.
public Type.Builder addFields(int index, Field.Builder builderForValue)
repeated .google.protobuf.Field fields = 2;
The list of fields.
public Type.Builder addAllFields(java.lang.Iterable<? extends Field> values)
repeated .google.protobuf.Field fields = 2;
The list of fields.
public Type.Builder clearFields()
repeated .google.protobuf.Field fields = 2;
The list of fields.
public Type.Builder removeFields(int index)
repeated .google.protobuf.Field fields = 2;
The list of fields.
public Field.Builder getFieldsBuilder(int index)
repeated .google.protobuf.Field fields = 2;
The list of fields.
public FieldOrBuilder getFieldsOrBuilder(int index)
repeated .google.protobuf.Field fields = 2;
The list of fields.
getFieldsOrBuilder in interface TypeOrBuilderpublic java.util.List<? extends FieldOrBuilder> getFieldsOrBuilderList()
repeated .google.protobuf.Field fields = 2;
The list of fields.
getFieldsOrBuilderList in interface TypeOrBuilderpublic Field.Builder addFieldsBuilder()
repeated .google.protobuf.Field fields = 2;
The list of fields.
public Field.Builder addFieldsBuilder(int index)
repeated .google.protobuf.Field fields = 2;
The list of fields.
public java.util.List<Field.Builder> getFieldsBuilderList()
repeated .google.protobuf.Field fields = 2;
The list of fields.
public ProtocolStringList getOneofsList()
repeated string oneofs = 3;
The list of oneof definitions.
getOneofsList in interface TypeOrBuilderpublic int getOneofsCount()
repeated string oneofs = 3;
The list of oneof definitions.
getOneofsCount in interface TypeOrBuilderpublic java.lang.String getOneofs(int index)
repeated string oneofs = 3;
The list of oneof definitions.
getOneofs in interface TypeOrBuilderpublic ByteString getOneofsBytes(int index)
repeated string oneofs = 3;
The list of oneof definitions.
getOneofsBytes in interface TypeOrBuilderpublic Type.Builder setOneofs(int index, java.lang.String value)
repeated string oneofs = 3;
The list of oneof definitions.
public Type.Builder addOneofs(java.lang.String value)
repeated string oneofs = 3;
The list of oneof definitions.
public Type.Builder addAllOneofs(java.lang.Iterable<java.lang.String> values)
repeated string oneofs = 3;
The list of oneof definitions.
public Type.Builder clearOneofs()
repeated string oneofs = 3;
The list of oneof definitions.
public Type.Builder addOneofsBytes(ByteString value)
repeated string oneofs = 3;
The list of oneof definitions.
public java.util.List<Option> getOptionsList()
repeated .google.protobuf.Option options = 4;
The proto options.
getOptionsList in interface TypeOrBuilderpublic int getOptionsCount()
repeated .google.protobuf.Option options = 4;
The proto options.
getOptionsCount in interface TypeOrBuilderpublic Option getOptions(int index)
repeated .google.protobuf.Option options = 4;
The proto options.
getOptions in interface TypeOrBuilderpublic Type.Builder setOptions(int index, Option value)
repeated .google.protobuf.Option options = 4;
The proto options.
public Type.Builder setOptions(int index, Option.Builder builderForValue)
repeated .google.protobuf.Option options = 4;
The proto options.
public Type.Builder addOptions(Option value)
repeated .google.protobuf.Option options = 4;
The proto options.
public Type.Builder addOptions(int index, Option value)
repeated .google.protobuf.Option options = 4;
The proto options.
public Type.Builder addOptions(Option.Builder builderForValue)
repeated .google.protobuf.Option options = 4;
The proto options.
public Type.Builder addOptions(int index, Option.Builder builderForValue)
repeated .google.protobuf.Option options = 4;
The proto options.
public Type.Builder addAllOptions(java.lang.Iterable<? extends Option> values)
repeated .google.protobuf.Option options = 4;
The proto options.
public Type.Builder clearOptions()
repeated .google.protobuf.Option options = 4;
The proto options.
public Type.Builder removeOptions(int index)
repeated .google.protobuf.Option options = 4;
The proto options.
public Option.Builder getOptionsBuilder(int index)
repeated .google.protobuf.Option options = 4;
The proto options.
public OptionOrBuilder getOptionsOrBuilder(int index)
repeated .google.protobuf.Option options = 4;
The proto options.
getOptionsOrBuilder in interface TypeOrBuilderpublic java.util.List<? extends OptionOrBuilder> getOptionsOrBuilderList()
repeated .google.protobuf.Option options = 4;
The proto options.
getOptionsOrBuilderList in interface TypeOrBuilderpublic Option.Builder addOptionsBuilder()
repeated .google.protobuf.Option options = 4;
The proto options.
public Option.Builder addOptionsBuilder(int index)
repeated .google.protobuf.Option options = 4;
The proto options.
public java.util.List<Option.Builder> getOptionsBuilderList()
repeated .google.protobuf.Option options = 4;
The proto options.
public boolean hasSourceContext()
optional .google.protobuf.SourceContext source_context = 5;
The source context.
hasSourceContext in interface TypeOrBuilderpublic SourceContext getSourceContext()
optional .google.protobuf.SourceContext source_context = 5;
The source context.
getSourceContext in interface TypeOrBuilderpublic Type.Builder setSourceContext(SourceContext value)
optional .google.protobuf.SourceContext source_context = 5;
The source context.
public Type.Builder setSourceContext(SourceContext.Builder builderForValue)
optional .google.protobuf.SourceContext source_context = 5;
The source context.
public Type.Builder mergeSourceContext(SourceContext value)
optional .google.protobuf.SourceContext source_context = 5;
The source context.
public Type.Builder clearSourceContext()
optional .google.protobuf.SourceContext source_context = 5;
The source context.
public SourceContext.Builder getSourceContextBuilder()
optional .google.protobuf.SourceContext source_context = 5;
The source context.
public SourceContextOrBuilder getSourceContextOrBuilder()
optional .google.protobuf.SourceContext source_context = 5;
The source context.
getSourceContextOrBuilder in interface TypeOrBuilderpublic int getSyntaxValue()
optional .google.protobuf.Syntax syntax = 6;
The source syntax.
getSyntaxValue in interface TypeOrBuilderpublic Type.Builder setSyntaxValue(int value)
optional .google.protobuf.Syntax syntax = 6;
The source syntax.
public Syntax getSyntax()
optional .google.protobuf.Syntax syntax = 6;
The source syntax.
getSyntax in interface TypeOrBuilderpublic Type.Builder setSyntax(Syntax value)
optional .google.protobuf.Syntax syntax = 6;
The source syntax.
public Type.Builder clearSyntax()
optional .google.protobuf.Syntax syntax = 6;
The source syntax.
public final Type.Builder setUnknownFields(UnknownFieldSet unknownFields)
Message.BuilderUnknownFieldSet for this message.setUnknownFields in interface Message.BuildersetUnknownFields in class GeneratedMessage.Builder<Type.Builder>public final Type.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Message.BuilderUnknownFieldSet for this
message.mergeUnknownFields in interface Message.BuildermergeUnknownFields in class GeneratedMessage.Builder<Type.Builder>