Class Field.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
All Implemented Interfaces:
FieldOrBuilder, Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, MessageOrBuilder, Cloneable
Enclosing class:
Field

public static final class Field.Builder extends GeneratedMessage.Builder<Field.Builder> implements FieldOrBuilder
Protobuf type google.protobuf.Field
  • 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<Field.Builder>
    • clear

      public Field.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 com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class GeneratedMessage.Builder<Field.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<Field.Builder>
    • getDefaultInstanceForType

      public Field getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface MessageOrBuilder
    • build

      public Field build()
      Specified by:
      build in interface Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public Field buildPartial()
      Specified by:
      buildPartial in interface Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

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

      public Field.Builder mergeFrom(Field other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class GeneratedMessage.Builder<Field.Builder>
    • mergeFrom

      public Field.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class AbstractMessage.Builder<Field.Builder>
      Throws:
      IOException
    • getKindValue

      public int getKindValue()
      .google.protobuf.Field.Kind kind = 1 [json_name = "kind"];
      Specified by:
      getKindValue in interface FieldOrBuilder
      Returns:
      The enum numeric value on the wire for kind.
    • setKindValue

      public Field.Builder setKindValue(int value)
      .google.protobuf.Field.Kind kind = 1 [json_name = "kind"];
      Parameters:
      value - The enum numeric value on the wire for kind to set.
      Returns:
      This builder for chaining.
    • getKind

      public Field.Kind getKind()
      .google.protobuf.Field.Kind kind = 1 [json_name = "kind"];
      Specified by:
      getKind in interface FieldOrBuilder
      Returns:
      The kind.
    • setKind

      public Field.Builder setKind(Field.Kind value)
      .google.protobuf.Field.Kind kind = 1 [json_name = "kind"];
      Parameters:
      value - The kind to set.
      Returns:
      This builder for chaining.
    • clearKind

      public Field.Builder clearKind()
      .google.protobuf.Field.Kind kind = 1 [json_name = "kind"];
      Returns:
      This builder for chaining.
    • getCardinalityValue

      public int getCardinalityValue()
      .google.protobuf.Field.Cardinality cardinality = 2 [json_name = "cardinality"];
      Specified by:
      getCardinalityValue in interface FieldOrBuilder
      Returns:
      The enum numeric value on the wire for cardinality.
    • setCardinalityValue

      public Field.Builder setCardinalityValue(int value)
      .google.protobuf.Field.Cardinality cardinality = 2 [json_name = "cardinality"];
      Parameters:
      value - The enum numeric value on the wire for cardinality to set.
      Returns:
      This builder for chaining.
    • getCardinality

      public Field.Cardinality getCardinality()
      .google.protobuf.Field.Cardinality cardinality = 2 [json_name = "cardinality"];
      Specified by:
      getCardinality in interface FieldOrBuilder
      Returns:
      The cardinality.
    • setCardinality

      public Field.Builder setCardinality(Field.Cardinality value)
      .google.protobuf.Field.Cardinality cardinality = 2 [json_name = "cardinality"];
      Parameters:
      value - The cardinality to set.
      Returns:
      This builder for chaining.
    • clearCardinality

      public Field.Builder clearCardinality()
      .google.protobuf.Field.Cardinality cardinality = 2 [json_name = "cardinality"];
      Returns:
      This builder for chaining.
    • getNumber

      public int getNumber()
      int32 number = 3 [json_name = "number"];
      Specified by:
      getNumber in interface FieldOrBuilder
      Returns:
      The number.
    • setNumber

      public Field.Builder setNumber(int value)
      int32 number = 3 [json_name = "number"];
      Parameters:
      value - The number to set.
      Returns:
      This builder for chaining.
    • clearNumber

      public Field.Builder clearNumber()
      int32 number = 3 [json_name = "number"];
      Returns:
      This builder for chaining.
    • getName

      public String getName()
      string name = 4 [json_name = "name"];
      Specified by:
      getName in interface FieldOrBuilder
      Returns:
      The name.
    • getNameBytes

      public com.google.protobuf.ByteString getNameBytes()
      string name = 4 [json_name = "name"];
      Specified by:
      getNameBytes in interface FieldOrBuilder
      Returns:
      The bytes for name.
    • setName

      public Field.Builder setName(String value)
      string name = 4 [json_name = "name"];
      Parameters:
      value - The name to set.
      Returns:
      This builder for chaining.
    • clearName

      public Field.Builder clearName()
      string name = 4 [json_name = "name"];
      Returns:
      This builder for chaining.
    • setNameBytes

      public Field.Builder setNameBytes(com.google.protobuf.ByteString value)
      string name = 4 [json_name = "name"];
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • getTypeUrl

      public String getTypeUrl()
      string type_url = 6 [json_name = "typeUrl"];
      Specified by:
      getTypeUrl in interface FieldOrBuilder
      Returns:
      The typeUrl.
    • getTypeUrlBytes

      public com.google.protobuf.ByteString getTypeUrlBytes()
      string type_url = 6 [json_name = "typeUrl"];
      Specified by:
      getTypeUrlBytes in interface FieldOrBuilder
      Returns:
      The bytes for typeUrl.
    • setTypeUrl

      public Field.Builder setTypeUrl(String value)
      string type_url = 6 [json_name = "typeUrl"];
      Parameters:
      value - The typeUrl to set.
      Returns:
      This builder for chaining.
    • clearTypeUrl

      public Field.Builder clearTypeUrl()
      string type_url = 6 [json_name = "typeUrl"];
      Returns:
      This builder for chaining.
    • setTypeUrlBytes

      public Field.Builder setTypeUrlBytes(com.google.protobuf.ByteString value)
      string type_url = 6 [json_name = "typeUrl"];
      Parameters:
      value - The bytes for typeUrl to set.
      Returns:
      This builder for chaining.
    • getOneofIndex

      public int getOneofIndex()
      int32 oneof_index = 7 [json_name = "oneofIndex"];
      Specified by:
      getOneofIndex in interface FieldOrBuilder
      Returns:
      The oneofIndex.
    • setOneofIndex

      public Field.Builder setOneofIndex(int value)
      int32 oneof_index = 7 [json_name = "oneofIndex"];
      Parameters:
      value - The oneofIndex to set.
      Returns:
      This builder for chaining.
    • clearOneofIndex

      public Field.Builder clearOneofIndex()
      int32 oneof_index = 7 [json_name = "oneofIndex"];
      Returns:
      This builder for chaining.
    • getPacked

      public boolean getPacked()
      bool packed = 8 [json_name = "packed"];
      Specified by:
      getPacked in interface FieldOrBuilder
      Returns:
      The packed.
    • setPacked

      public Field.Builder setPacked(boolean value)
      bool packed = 8 [json_name = "packed"];
      Parameters:
      value - The packed to set.
      Returns:
      This builder for chaining.
    • clearPacked

      public Field.Builder clearPacked()
      bool packed = 8 [json_name = "packed"];
      Returns:
      This builder for chaining.
    • getOptionsList

      public List<Option> getOptionsList()
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
      Specified by:
      getOptionsList in interface FieldOrBuilder
    • getOptionsCount

      public int getOptionsCount()
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
      Specified by:
      getOptionsCount in interface FieldOrBuilder
    • getOptions

      public Option getOptions(int index)
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
      Specified by:
      getOptions in interface FieldOrBuilder
    • setOptions

      public Field.Builder setOptions(int index, Option value)
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
    • setOptions

      public Field.Builder setOptions(int index, Option.Builder builderForValue)
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
    • addOptions

      public Field.Builder addOptions(Option value)
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
    • addOptions

      public Field.Builder addOptions(int index, Option value)
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
    • addOptions

      public Field.Builder addOptions(Option.Builder builderForValue)
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
    • addOptions

      public Field.Builder addOptions(int index, Option.Builder builderForValue)
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
    • addAllOptions

      public Field.Builder addAllOptions(Iterable<? extends Option> values)
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
    • clearOptions

      public Field.Builder clearOptions()
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
    • removeOptions

      public Field.Builder removeOptions(int index)
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
    • getOptionsBuilder

      public Option.Builder getOptionsBuilder(int index)
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
    • getOptionsOrBuilder

      public OptionOrBuilder getOptionsOrBuilder(int index)
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
      Specified by:
      getOptionsOrBuilder in interface FieldOrBuilder
    • getOptionsOrBuilderList

      public List<? extends OptionOrBuilder> getOptionsOrBuilderList()
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
      Specified by:
      getOptionsOrBuilderList in interface FieldOrBuilder
    • addOptionsBuilder

      public Option.Builder addOptionsBuilder()
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
    • addOptionsBuilder

      public Option.Builder addOptionsBuilder(int index)
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
    • getOptionsBuilderList

      public List<Option.Builder> getOptionsBuilderList()
      repeated .google.protobuf.Option options = 9 [json_name = "options"];
    • getJsonName

      public String getJsonName()
      string json_name = 10 [json_name = "jsonName"];
      Specified by:
      getJsonName in interface FieldOrBuilder
      Returns:
      The jsonName.
    • getJsonNameBytes

      public com.google.protobuf.ByteString getJsonNameBytes()
      string json_name = 10 [json_name = "jsonName"];
      Specified by:
      getJsonNameBytes in interface FieldOrBuilder
      Returns:
      The bytes for jsonName.
    • setJsonName

      public Field.Builder setJsonName(String value)
      string json_name = 10 [json_name = "jsonName"];
      Parameters:
      value - The jsonName to set.
      Returns:
      This builder for chaining.
    • clearJsonName

      public Field.Builder clearJsonName()
      string json_name = 10 [json_name = "jsonName"];
      Returns:
      This builder for chaining.
    • setJsonNameBytes

      public Field.Builder setJsonNameBytes(com.google.protobuf.ByteString value)
      string json_name = 10 [json_name = "jsonName"];
      Parameters:
      value - The bytes for jsonName to set.
      Returns:
      This builder for chaining.
    • getDefaultValue

      public String getDefaultValue()
      string default_value = 11 [json_name = "defaultValue"];
      Specified by:
      getDefaultValue in interface FieldOrBuilder
      Returns:
      The defaultValue.
    • getDefaultValueBytes

      public com.google.protobuf.ByteString getDefaultValueBytes()
      string default_value = 11 [json_name = "defaultValue"];
      Specified by:
      getDefaultValueBytes in interface FieldOrBuilder
      Returns:
      The bytes for defaultValue.
    • setDefaultValue

      public Field.Builder setDefaultValue(String value)
      string default_value = 11 [json_name = "defaultValue"];
      Parameters:
      value - The defaultValue to set.
      Returns:
      This builder for chaining.
    • clearDefaultValue

      public Field.Builder clearDefaultValue()
      string default_value = 11 [json_name = "defaultValue"];
      Returns:
      This builder for chaining.
    • setDefaultValueBytes

      public Field.Builder setDefaultValueBytes(com.google.protobuf.ByteString value)
      string default_value = 11 [json_name = "defaultValue"];
      Parameters:
      value - The bytes for defaultValue to set.
      Returns:
      This builder for chaining.