Class Field.Builder

All Implemented Interfaces:
FieldOrBuilder, MessageLite.Builder, MessageLiteOrBuilder, Cloneable
Enclosing class:
Field

public static final class Field.Builder extends GeneratedMessageLite.Builder<Field, Field.Builder> implements FieldOrBuilder
A single field of a message type.

New usages of this message as an alternative to FieldDescriptorProto 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.Field
  • Constructor Details

    • Builder

      private Builder()
  • Method Details

    • getKindValue

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

      public Field.Builder setKindValue(int value)
      The field type.
      
      .google.protobuf.Field.Kind kind = 1;
      Parameters:
      value - The kind to set.
      Returns:
      This builder for chaining.
    • getKind

      public Field.Kind getKind()
      The field type.
      
      .google.protobuf.Field.Kind kind = 1;
      Specified by:
      getKind in interface FieldOrBuilder
      Returns:
      The kind.
    • setKind

      public Field.Builder setKind(Field.Kind value)
      The field type.
      
      .google.protobuf.Field.Kind kind = 1;
      Parameters:
      value - The enum numeric value on the wire for kind to set.
      Returns:
      This builder for chaining.
    • clearKind

      public Field.Builder clearKind()
      The field type.
      
      .google.protobuf.Field.Kind kind = 1;
      Returns:
      This builder for chaining.
    • getCardinalityValue

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

      public Field.Builder setCardinalityValue(int value)
      The field cardinality.
      
      .google.protobuf.Field.Cardinality cardinality = 2;
      Parameters:
      value - The cardinality to set.
      Returns:
      This builder for chaining.
    • getCardinality

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

      public Field.Builder setCardinality(Field.Cardinality value)
      The field cardinality.
      
      .google.protobuf.Field.Cardinality cardinality = 2;
      Parameters:
      value - The enum numeric value on the wire for cardinality to set.
      Returns:
      This builder for chaining.
    • clearCardinality

      public Field.Builder clearCardinality()
      The field cardinality.
      
      .google.protobuf.Field.Cardinality cardinality = 2;
      Returns:
      This builder for chaining.
    • getNumber

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

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

      public Field.Builder clearNumber()
      The field number.
      
      int32 number = 3;
      Returns:
      This builder for chaining.
    • getName

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

      public ByteString getNameBytes()
      The field name.
      
      string name = 4;
      Specified by:
      getNameBytes in interface FieldOrBuilder
      Returns:
      The bytes for name.
    • setName

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

      public Field.Builder clearName()
      The field name.
      
      string name = 4;
      Returns:
      This builder for chaining.
    • setNameBytes

      public Field.Builder setNameBytes(ByteString value)
      The field name.
      
      string name = 4;
      Parameters:
      value - The bytes for name to set.
      Returns:
      This builder for chaining.
    • getTypeUrl

      public String getTypeUrl()
      The field type URL, without the scheme, for message or enumeration
      types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
      
      string type_url = 6;
      Specified by:
      getTypeUrl in interface FieldOrBuilder
      Returns:
      The typeUrl.
    • getTypeUrlBytes

      public ByteString getTypeUrlBytes()
      The field type URL, without the scheme, for message or enumeration
      types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
      
      string type_url = 6;
      Specified by:
      getTypeUrlBytes in interface FieldOrBuilder
      Returns:
      The bytes for typeUrl.
    • setTypeUrl

      public Field.Builder setTypeUrl(String value)
      The field type URL, without the scheme, for message or enumeration
      types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
      
      string type_url = 6;
      Parameters:
      value - The typeUrl to set.
      Returns:
      This builder for chaining.
    • clearTypeUrl

      public Field.Builder clearTypeUrl()
      The field type URL, without the scheme, for message or enumeration
      types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
      
      string type_url = 6;
      Returns:
      This builder for chaining.
    • setTypeUrlBytes

      public Field.Builder setTypeUrlBytes(ByteString value)
      The field type URL, without the scheme, for message or enumeration
      types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`.
      
      string type_url = 6;
      Parameters:
      value - The bytes for typeUrl to set.
      Returns:
      This builder for chaining.
    • getOneofIndex

      public int getOneofIndex()
      The index of the field type in `Type.oneofs`, for message or enumeration
      types. The first type has index 1; zero means the type is not in the list.
      
      int32 oneof_index = 7;
      Specified by:
      getOneofIndex in interface FieldOrBuilder
      Returns:
      The oneofIndex.
    • setOneofIndex

      public Field.Builder setOneofIndex(int value)
      The index of the field type in `Type.oneofs`, for message or enumeration
      types. The first type has index 1; zero means the type is not in the list.
      
      int32 oneof_index = 7;
      Parameters:
      value - The oneofIndex to set.
      Returns:
      This builder for chaining.
    • clearOneofIndex

      public Field.Builder clearOneofIndex()
      The index of the field type in `Type.oneofs`, for message or enumeration
      types. The first type has index 1; zero means the type is not in the list.
      
      int32 oneof_index = 7;
      Returns:
      This builder for chaining.
    • getPacked

      public boolean getPacked()
      Whether to use alternative packed wire representation.
      
      bool packed = 8;
      Specified by:
      getPacked in interface FieldOrBuilder
      Returns:
      The packed.
    • setPacked

      public Field.Builder setPacked(boolean value)
      Whether to use alternative packed wire representation.
      
      bool packed = 8;
      Parameters:
      value - The packed to set.
      Returns:
      This builder for chaining.
    • clearPacked

      public Field.Builder clearPacked()
      Whether to use alternative packed wire representation.
      
      bool packed = 8;
      Returns:
      This builder for chaining.
    • getOptionsList

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

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

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

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

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

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

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

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

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

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

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

      public Field.Builder removeOptions(int index)
      The protocol buffer options.
      
      repeated .google.protobuf.Option options = 9;
    • getJsonName

      public String getJsonName()
      The field JSON name.
      
      string json_name = 10;
      Specified by:
      getJsonName in interface FieldOrBuilder
      Returns:
      The jsonName.
    • getJsonNameBytes

      public ByteString getJsonNameBytes()
      The field JSON name.
      
      string json_name = 10;
      Specified by:
      getJsonNameBytes in interface FieldOrBuilder
      Returns:
      The bytes for jsonName.
    • setJsonName

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

      public Field.Builder clearJsonName()
      The field JSON name.
      
      string json_name = 10;
      Returns:
      This builder for chaining.
    • setJsonNameBytes

      public Field.Builder setJsonNameBytes(ByteString value)
      The field JSON name.
      
      string json_name = 10;
      Parameters:
      value - The bytes for jsonName to set.
      Returns:
      This builder for chaining.
    • getDefaultValue

      public String getDefaultValue()
      The string value of the default value of this field. Proto2 syntax only.
      
      string default_value = 11;
      Specified by:
      getDefaultValue in interface FieldOrBuilder
      Returns:
      The defaultValue.
    • getDefaultValueBytes

      public ByteString getDefaultValueBytes()
      The string value of the default value of this field. Proto2 syntax only.
      
      string default_value = 11;
      Specified by:
      getDefaultValueBytes in interface FieldOrBuilder
      Returns:
      The bytes for defaultValue.
    • setDefaultValue

      public Field.Builder setDefaultValue(String value)
      The string value of the default value of this field. Proto2 syntax only.
      
      string default_value = 11;
      Parameters:
      value - The defaultValue to set.
      Returns:
      This builder for chaining.
    • clearDefaultValue

      public Field.Builder clearDefaultValue()
      The string value of the default value of this field. Proto2 syntax only.
      
      string default_value = 11;
      Returns:
      This builder for chaining.
    • setDefaultValueBytes

      public Field.Builder setDefaultValueBytes(ByteString value)
      The string value of the default value of this field. Proto2 syntax only.
      
      string default_value = 11;
      Parameters:
      value - The bytes for defaultValue to set.
      Returns:
      This builder for chaining.