Class Type.Builder

All Implemented Interfaces:
Message.Builder, MessageLite.Builder, MessageLiteOrBuilder, MessageOrBuilder, TypeOrBuilder, Cloneable
Enclosing class:
Type

public static final class Type.Builder extends GeneratedMessage.Builder<Type.Builder> implements TypeOrBuilder
A protocol buffer message type.

New usages of this message as an alternative to DescriptorProto are strongly
discouraged. This message does not reliability preserve all information
necessary to model the schema and preserve semantics. Instead make use of
FileDescriptorSet which preserves the necessary information.
Protobuf type google.protobuf.Type
  • Field Details

  • Constructor Details

  • Method Details

    • getDescriptor

      public static final Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Description copied from class: GeneratedMessage.Builder
      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.
      Specified by:
      internalGetFieldAccessorTable in class GeneratedMessage.Builder<Type.Builder>
    • maybeForceBuilderInitialization

      private void maybeForceBuilderInitialization()
    • clear

      public Type.Builder clear()
      Description copied from class: GeneratedMessage.Builder
      Called by the initialization and clear code paths to allow subclasses to reset any of their builtin fields back to the initial values.
      Specified by:
      clear in interface Message.Builder
      Specified by:
      clear in interface MessageLite.Builder
      Overrides:
      clear in class GeneratedMessage.Builder<Type.Builder>
    • getDescriptorForType

      public Descriptors.Descriptor getDescriptorForType()
      Description copied from interface: Message.Builder
      Get the message's type's descriptor. See MessageOrBuilder.getDescriptorForType().
      Specified by:
      getDescriptorForType in interface Message.Builder
      Specified by:
      getDescriptorForType in interface MessageOrBuilder
      Overrides:
      getDescriptorForType in class GeneratedMessage.Builder<Type.Builder>
    • getDefaultInstanceForType

      public Type getDefaultInstanceForType()
      Description copied from interface: MessageLiteOrBuilder
      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.
      Specified by:
      getDefaultInstanceForType in interface MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface MessageOrBuilder
    • build

      public Type build()
      Description copied from interface: MessageLite.Builder
      Constructs the message based on the state of the Builder. Subsequent changes to the Builder will not affect the returned message.
      Specified by:
      build in interface Message.Builder
      Specified by:
      build in interface MessageLite.Builder
    • buildPartial

      public Type buildPartial()
      Description copied from interface: MessageLite.Builder
      Like 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.
      Specified by:
      buildPartial in interface Message.Builder
      Specified by:
      buildPartial in interface MessageLite.Builder
    • buildPartialRepeatedFields

      private void buildPartialRepeatedFields(Type result)
    • buildPartial0

      private void buildPartial0(Type result)
    • mergeFrom

      public Type.Builder mergeFrom(Message other)
      Description copied from interface: Message.Builder
      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, 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++.

      Specified by:
      mergeFrom in interface Message.Builder
      Overrides:
      mergeFrom in class AbstractMessage.Builder<Type.Builder>
    • mergeFrom

      public Type.Builder mergeFrom(Type other)
    • isInitialized

      public final boolean isInitialized()
      Description copied from interface: MessageLiteOrBuilder
      Returns true if all required fields in the message and all embedded messages are set, false otherwise.

      See also: MessageOrBuilder.getInitializationErrorString()

      Specified by:
      isInitialized in interface MessageLiteOrBuilder
      Overrides:
      isInitialized in class GeneratedMessage.Builder<Type.Builder>
    • mergeFrom

      public Type.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws IOException
      Description copied from interface: MessageLite.Builder
      Like 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.
      Specified by:
      mergeFrom in interface Message.Builder
      Specified by:
      mergeFrom in interface MessageLite.Builder
      Overrides:
      mergeFrom in class AbstractMessage.Builder<Type.Builder>
      Throws:
      IOException - an I/O error reading from the stream
    • getName

      public String getName()
      The fully qualified message name.
      
      string name = 1;
      Specified by:
      getName in interface TypeOrBuilder
      Returns:
      The name.
    • getNameBytes

      public ByteString getNameBytes()
      The fully qualified message name.
      
      string name = 1;
      Specified by:
      getNameBytes in interface TypeOrBuilder
      Returns:
      The bytes for name.
    • setName

      public Type.Builder setName(String value)
      The fully qualified message name.
      
      string name = 1;
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public Type.Builder clearName()
      The fully qualified message name.
      
      string name = 1;
      Returns:
      This builder for chaining.
    • setNameBytes

      public Type.Builder setNameBytes(ByteString value)
      The fully qualified message name.
      
      string name = 1;
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • ensureFieldsIsMutable

      private void ensureFieldsIsMutable()
    • getFieldsList

      public List<Field> getFieldsList()
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
      Specified by:
      getFieldsList in interface TypeOrBuilder
    • getFieldsCount

      public int getFieldsCount()
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
      Specified by:
      getFieldsCount in interface TypeOrBuilder
    • getFields

      public Field getFields(int index)
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
      Specified by:
      getFields in interface TypeOrBuilder
    • setFields

      public Type.Builder setFields(int index, Field value)
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
    • setFields

      public Type.Builder setFields(int index, Field.Builder builderForValue)
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
    • addFields

      public Type.Builder addFields(Field value)
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
    • addFields

      public Type.Builder addFields(int index, Field value)
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
    • addFields

      public Type.Builder addFields(Field.Builder builderForValue)
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
    • addFields

      public Type.Builder addFields(int index, Field.Builder builderForValue)
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
    • addAllFields

      public Type.Builder addAllFields(Iterable<? extends Field> values)
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
    • clearFields

      public Type.Builder clearFields()
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
    • removeFields

      public Type.Builder removeFields(int index)
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
    • getFieldsBuilder

      public Field.Builder getFieldsBuilder(int index)
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
    • getFieldsOrBuilder

      public FieldOrBuilder getFieldsOrBuilder(int index)
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
      Specified by:
      getFieldsOrBuilder in interface TypeOrBuilder
    • getFieldsOrBuilderList

      public List<? extends FieldOrBuilder> getFieldsOrBuilderList()
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
      Specified by:
      getFieldsOrBuilderList in interface TypeOrBuilder
    • addFieldsBuilder

      public Field.Builder addFieldsBuilder()
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
    • addFieldsBuilder

      public Field.Builder addFieldsBuilder(int index)
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
    • getFieldsBuilderList

      public List<Field.Builder> getFieldsBuilderList()
      The list of fields.
      
      repeated .google.protobuf.Field fields = 2;
    • internalGetFieldsFieldBuilder

      private RepeatedFieldBuilder<Field, Field.Builder, FieldOrBuilder> internalGetFieldsFieldBuilder()
    • ensureOneofsIsMutable

      private void ensureOneofsIsMutable()
    • getOneofsList

      public ProtocolStringList getOneofsList()
      The list of types appearing in `oneof` definitions in this type.
      
      repeated string oneofs = 3;
      Specified by:
      getOneofsList in interface TypeOrBuilder
      Returns:
      A list containing the oneofs.
    • getOneofsCount

      public int getOneofsCount()
      The list of types appearing in `oneof` definitions in this type.
      
      repeated string oneofs = 3;
      Specified by:
      getOneofsCount in interface TypeOrBuilder
      Returns:
      The count of oneofs.
    • getOneofs

      public String getOneofs(int index)
      The list of types appearing in `oneof` definitions in this type.
      
      repeated string oneofs = 3;
      Specified by:
      getOneofs in interface TypeOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The oneofs at the given index.
    • getOneofsBytes

      public ByteString getOneofsBytes(int index)
      The list of types appearing in `oneof` definitions in this type.
      
      repeated string oneofs = 3;
      Specified by:
      getOneofsBytes in interface TypeOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the oneofs at the given index.
    • setOneofs

      public Type.Builder setOneofs(int index, String value)
      The list of types appearing in `oneof` definitions in this type.
      
      repeated string oneofs = 3;
      Parameters:
      index - The index to set the value at.
      value - The oneofs to set.
      Returns:
      This builder for chaining.
    • addOneofs

      public Type.Builder addOneofs(String value)
      The list of types appearing in `oneof` definitions in this type.
      
      repeated string oneofs = 3;
      Parameters:
      value - The oneofs to add.
      Returns:
      This builder for chaining.
    • addAllOneofs

      public Type.Builder addAllOneofs(Iterable<String> values)
      The list of types appearing in `oneof` definitions in this type.
      
      repeated string oneofs = 3;
      Parameters:
      values - The oneofs to add.
      Returns:
      This builder for chaining.
    • clearOneofs

      public Type.Builder clearOneofs()
      The list of types appearing in `oneof` definitions in this type.
      
      repeated string oneofs = 3;
      Returns:
      This builder for chaining.
    • addOneofsBytes

      public Type.Builder addOneofsBytes(ByteString value)
      The list of types appearing in `oneof` definitions in this type.
      
      repeated string oneofs = 3;
      Parameters:
      value - The bytes of the oneofs to add.
      Returns:
      This builder for chaining.
    • ensureOptionsIsMutable

      private void ensureOptionsIsMutable()
    • getOptionsList

      public List<Option> getOptionsList()
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
      Specified by:
      getOptionsList in interface TypeOrBuilder
    • getOptionsCount

      public int getOptionsCount()
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
      Specified by:
      getOptionsCount in interface TypeOrBuilder
    • getOptions

      public Option getOptions(int index)
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
      Specified by:
      getOptions in interface TypeOrBuilder
    • setOptions

      public Type.Builder setOptions(int index, Option value)
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
    • setOptions

      public Type.Builder setOptions(int index, Option.Builder builderForValue)
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
    • addOptions

      public Type.Builder addOptions(Option value)
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
    • addOptions

      public Type.Builder addOptions(int index, Option value)
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
    • addOptions

      public Type.Builder addOptions(Option.Builder builderForValue)
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
    • addOptions

      public Type.Builder addOptions(int index, Option.Builder builderForValue)
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
    • addAllOptions

      public Type.Builder addAllOptions(Iterable<? extends Option> values)
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
    • clearOptions

      public Type.Builder clearOptions()
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
    • removeOptions

      public Type.Builder removeOptions(int index)
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
    • getOptionsBuilder

      public Option.Builder getOptionsBuilder(int index)
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
    • getOptionsOrBuilder

      public OptionOrBuilder getOptionsOrBuilder(int index)
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
      Specified by:
      getOptionsOrBuilder in interface TypeOrBuilder
    • getOptionsOrBuilderList

      public List<? extends OptionOrBuilder> getOptionsOrBuilderList()
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
      Specified by:
      getOptionsOrBuilderList in interface TypeOrBuilder
    • addOptionsBuilder

      public Option.Builder addOptionsBuilder()
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
    • addOptionsBuilder

      public Option.Builder addOptionsBuilder(int index)
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
    • getOptionsBuilderList

      public List<Option.Builder> getOptionsBuilderList()
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 4;
    • internalGetOptionsFieldBuilder

      private RepeatedFieldBuilder<Option, Option.Builder, OptionOrBuilder> internalGetOptionsFieldBuilder()
    • hasSourceContext

      public boolean hasSourceContext()
      The source context.
      
      .google.protobuf.SourceContext source_context = 5;
      Specified by:
      hasSourceContext in interface TypeOrBuilder
      Returns:
      Whether the sourceContext field is set.
    • getSourceContext

      public SourceContext getSourceContext()
      The source context.
      
      .google.protobuf.SourceContext source_context = 5;
      Specified by:
      getSourceContext in interface TypeOrBuilder
      Returns:
      The sourceContext.
    • setSourceContext

      public Type.Builder setSourceContext(SourceContext value)
      The source context.
      
      .google.protobuf.SourceContext source_context = 5;
    • setSourceContext

      public Type.Builder setSourceContext(SourceContext.Builder builderForValue)
      The source context.
      
      .google.protobuf.SourceContext source_context = 5;
    • mergeSourceContext

      public Type.Builder mergeSourceContext(SourceContext value)
      The source context.
      
      .google.protobuf.SourceContext source_context = 5;
    • clearSourceContext

      public Type.Builder clearSourceContext()
      The source context.
      
      .google.protobuf.SourceContext source_context = 5;
    • getSourceContextBuilder

      public SourceContext.Builder getSourceContextBuilder()
      The source context.
      
      .google.protobuf.SourceContext source_context = 5;
    • getSourceContextOrBuilder

      public SourceContextOrBuilder getSourceContextOrBuilder()
      The source context.
      
      .google.protobuf.SourceContext source_context = 5;
      Specified by:
      getSourceContextOrBuilder in interface TypeOrBuilder
    • internalGetSourceContextFieldBuilder

      private SingleFieldBuilder<SourceContext, SourceContext.Builder, SourceContextOrBuilder> internalGetSourceContextFieldBuilder()
      The source context.
      
      .google.protobuf.SourceContext source_context = 5;
    • getSyntaxValue

      public int getSyntaxValue()
      The source syntax.
      
      .google.protobuf.Syntax syntax = 6;
      Specified by:
      getSyntaxValue in interface TypeOrBuilder
      Returns:
      The enum numeric value on the wire for syntax.
    • setSyntaxValue

      public Type.Builder setSyntaxValue(int value)
      The source syntax.
      
      .google.protobuf.Syntax syntax = 6;
      Parameters:
      value - The enum numeric value on the wire for syntax to set.
      Returns:
      This builder for chaining.
      Throws:
      IllegalArgumentException - if UNRECOGNIZED is provided.
    • getSyntax

      public Syntax getSyntax()
      The source syntax.
      
      .google.protobuf.Syntax syntax = 6;
      Specified by:
      getSyntax in interface TypeOrBuilder
      Returns:
      The syntax.
    • setSyntax

      public Type.Builder setSyntax(Syntax value)
      The source syntax.
      
      .google.protobuf.Syntax syntax = 6;
      Parameters:
      value - The syntax to set.
      Returns:
      This builder for chaining.
    • clearSyntax

      public Type.Builder clearSyntax()
      The source syntax.
      
      .google.protobuf.Syntax syntax = 6;
      Returns:
      This builder for chaining.
    • getEdition

      public String getEdition()
      The source edition string, only valid when syntax is SYNTAX_EDITIONS.
      
      string edition = 7;
      Specified by:
      getEdition in interface TypeOrBuilder
      Returns:
      The edition.
    • getEditionBytes

      public ByteString getEditionBytes()
      The source edition string, only valid when syntax is SYNTAX_EDITIONS.
      
      string edition = 7;
      Specified by:
      getEditionBytes in interface TypeOrBuilder
      Returns:
      The bytes for edition.
    • setEdition

      public Type.Builder setEdition(String value)
      The source edition string, only valid when syntax is SYNTAX_EDITIONS.
      
      string edition = 7;
      Parameters:
      value - The edition to set.
      Returns:
      This builder for chaining.
    • clearEdition

      public Type.Builder clearEdition()
      The source edition string, only valid when syntax is SYNTAX_EDITIONS.
      
      string edition = 7;
      Returns:
      This builder for chaining.
    • setEditionBytes

      public Type.Builder setEditionBytes(ByteString value)
      The source edition string, only valid when syntax is SYNTAX_EDITIONS.
      
      string edition = 7;
      Parameters:
      value - The bytes for edition to set.
      Returns:
      This builder for chaining.