Class Enum.Builder

All Implemented Interfaces:
EnumOrBuilder, Message.Builder, MessageLite.Builder, MessageLiteOrBuilder, MessageOrBuilder, Cloneable
Enclosing class:
Enum

public static final class Enum.Builder extends GeneratedMessage.Builder<Enum.Builder> implements EnumOrBuilder
Enum type definition.

New usages of this message as an alternative to EnumDescriptorProto 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.Enum
  • 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<Enum.Builder>
    • maybeForceBuilderInitialization

      private void maybeForceBuilderInitialization()
    • clear

      public Enum.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<Enum.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<Enum.Builder>
    • getDefaultInstanceForType

      public Enum 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 Enum 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 Enum 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(Enum result)
    • buildPartial0

      private void buildPartial0(Enum result)
    • mergeFrom

      public Enum.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<Enum.Builder>
    • mergeFrom

      public Enum.Builder mergeFrom(Enum 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<Enum.Builder>
    • mergeFrom

      public Enum.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<Enum.Builder>
      Throws:
      IOException - an I/O error reading from the stream
    • getName

      public String getName()
      Enum type name.
      
      string name = 1;
      Specified by:
      getName in interface EnumOrBuilder
      Returns:
      The name.
    • getNameBytes

      public ByteString getNameBytes()
      Enum type name.
      
      string name = 1;
      Specified by:
      getNameBytes in interface EnumOrBuilder
      Returns:
      The bytes for name.
    • setName

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

      public Enum.Builder clearName()
      Enum type name.
      
      string name = 1;
      Returns:
      This builder for chaining.
    • setNameBytes

      public Enum.Builder setNameBytes(ByteString value)
      Enum type name.
      
      string name = 1;
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • ensureEnumvalueIsMutable

      private void ensureEnumvalueIsMutable()
    • getEnumvalueList

      public List<EnumValue> getEnumvalueList()
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
      Specified by:
      getEnumvalueList in interface EnumOrBuilder
    • getEnumvalueCount

      public int getEnumvalueCount()
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
      Specified by:
      getEnumvalueCount in interface EnumOrBuilder
    • getEnumvalue

      public EnumValue getEnumvalue(int index)
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
      Specified by:
      getEnumvalue in interface EnumOrBuilder
    • setEnumvalue

      public Enum.Builder setEnumvalue(int index, EnumValue value)
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
    • setEnumvalue

      public Enum.Builder setEnumvalue(int index, EnumValue.Builder builderForValue)
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
    • addEnumvalue

      public Enum.Builder addEnumvalue(EnumValue value)
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
    • addEnumvalue

      public Enum.Builder addEnumvalue(int index, EnumValue value)
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
    • addEnumvalue

      public Enum.Builder addEnumvalue(EnumValue.Builder builderForValue)
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
    • addEnumvalue

      public Enum.Builder addEnumvalue(int index, EnumValue.Builder builderForValue)
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
    • addAllEnumvalue

      public Enum.Builder addAllEnumvalue(Iterable<? extends EnumValue> values)
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
    • clearEnumvalue

      public Enum.Builder clearEnumvalue()
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
    • removeEnumvalue

      public Enum.Builder removeEnumvalue(int index)
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
    • getEnumvalueBuilder

      public EnumValue.Builder getEnumvalueBuilder(int index)
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
    • getEnumvalueOrBuilder

      public EnumValueOrBuilder getEnumvalueOrBuilder(int index)
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
      Specified by:
      getEnumvalueOrBuilder in interface EnumOrBuilder
    • getEnumvalueOrBuilderList

      public List<? extends EnumValueOrBuilder> getEnumvalueOrBuilderList()
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
      Specified by:
      getEnumvalueOrBuilderList in interface EnumOrBuilder
    • addEnumvalueBuilder

      public EnumValue.Builder addEnumvalueBuilder()
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
    • addEnumvalueBuilder

      public EnumValue.Builder addEnumvalueBuilder(int index)
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
    • getEnumvalueBuilderList

      public List<EnumValue.Builder> getEnumvalueBuilderList()
      Enum value definitions.
      
      repeated .google.protobuf.EnumValue enumvalue = 2;
    • internalGetEnumvalueFieldBuilder

      private RepeatedFieldBuilder<EnumValue, EnumValue.Builder, EnumValueOrBuilder> internalGetEnumvalueFieldBuilder()
    • ensureOptionsIsMutable

      private void ensureOptionsIsMutable()
    • getOptionsList

      public List<Option> getOptionsList()
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
      Specified by:
      getOptionsList in interface EnumOrBuilder
    • getOptionsCount

      public int getOptionsCount()
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
      Specified by:
      getOptionsCount in interface EnumOrBuilder
    • getOptions

      public Option getOptions(int index)
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
      Specified by:
      getOptions in interface EnumOrBuilder
    • setOptions

      public Enum.Builder setOptions(int index, Option value)
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
    • setOptions

      public Enum.Builder setOptions(int index, Option.Builder builderForValue)
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
    • addOptions

      public Enum.Builder addOptions(Option value)
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
    • addOptions

      public Enum.Builder addOptions(int index, Option value)
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
    • addOptions

      public Enum.Builder addOptions(Option.Builder builderForValue)
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
    • addOptions

      public Enum.Builder addOptions(int index, Option.Builder builderForValue)
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
    • addAllOptions

      public Enum.Builder addAllOptions(Iterable<? extends Option> values)
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
    • clearOptions

      public Enum.Builder clearOptions()
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
    • removeOptions

      public Enum.Builder removeOptions(int index)
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
    • getOptionsBuilder

      public Option.Builder getOptionsBuilder(int index)
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
    • getOptionsOrBuilder

      public OptionOrBuilder getOptionsOrBuilder(int index)
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
      Specified by:
      getOptionsOrBuilder in interface EnumOrBuilder
    • getOptionsOrBuilderList

      public List<? extends OptionOrBuilder> getOptionsOrBuilderList()
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
      Specified by:
      getOptionsOrBuilderList in interface EnumOrBuilder
    • addOptionsBuilder

      public Option.Builder addOptionsBuilder()
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
    • addOptionsBuilder

      public Option.Builder addOptionsBuilder(int index)
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
    • getOptionsBuilderList

      public List<Option.Builder> getOptionsBuilderList()
      Protocol buffer options.
      
      repeated .google.protobuf.Option options = 3;
    • internalGetOptionsFieldBuilder

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

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

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

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

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

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

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

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

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

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

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

      public Enum.Builder setSyntaxValue(int value)
      The source syntax.
      
      .google.protobuf.Syntax syntax = 5;
      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 = 5;
      Specified by:
      getSyntax in interface EnumOrBuilder
      Returns:
      The syntax.
    • setSyntax

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

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

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

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

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

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

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