# This file was generated by generate_stubs.rb
# Do not edit this file directly.

# A FieldDescriptor provides information about the Protobuf definition of a
# field inside a {Descriptor}.
class Google::Protobuf::FieldDescriptor

  # Returns a new field descriptor. Its name, type, etc. must be set before it is
  # added to a message type.
  def initialize; end

  # Returns the name of this field.
  # 
  # @return [String]
  def name; end

  # Returns this field's type, as a Ruby symbol, or nil if not yet set.
  # 
  # Valid field types are:
  #     :int32, :int64, :uint32, :uint64, :float, :double, :bool, :string,
  #     :bytes, :message.
  # 
  # @return [Symbol]
  def type; end

  # Returns this field's default, as a Ruby object, or nil if not yet set.
  # 
  # @return [Object,nil]
  def default; end

  # Returns whether this is a required field.
  # 
  # @return [Boolean]
  def required?; end

  # Returns whether this is a repeated field.
  # @return [Boolean]
  def repeated?; end

  # Returns whether this is a repeated field that uses packed encoding.
  # @return [Boolean]
  def is_packed?; end

  # Returns this field's json_name, as a Ruby string, or nil if not yet set.
  # 
  # @return [String,nil]
  def json_name; end

  # Returns this field's label (i.e., plurality), as a Ruby symbol.
  # Valid field labels are:
  #   :optional, :repeated
  # 
  # @return [Symbol]
  # @deprecated Use {#repeated?} or {#required?} instead.
  def label; end

  # Returns the tag number for this field.
  # 
  # @return [Integer]
  def number; end

  # Returns the name of the message or enum type corresponding to this field, if
  # it is a message or enum field (respectively), or nil otherwise. This type
  # name will be resolved within the context of the pool to which the containing
  # message type is added.
  # 
  # @return [String,nil]
  def submsg_name; end

  # Returns the message or enum descriptor corresponding to this field's type if
  # it is a message or enum field, respectively, or nil otherwise. Cannot be
  # called *until* the containing message type is added to a pool (and thus
  # resolved).
  # 
  # @return [Descriptor,EnumDescriptor,nil]
  def subtype; end

  # Returns the value set for this field on the given message. Raises an
  # exception if message is of the wrong type.
  # 
  # @param message [AbstractMessage]
  # @return [Object]
  def get(message); end

  # Clears the field from the message if it's set.
  # 
  # @param message [AbstractMessage]
  # @return [nil]
  def clear(message); end

  # Sets the value corresponding to this field to the given value on the given
  # message. Raises an exception if message is of the wrong type. Performs the
  # ordinary type-checks for field setting.
  # 
  # @param message [AbstractMessage]
  # @param value [Object]
  def set(message, value); end

  # Returns the
  # {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L656
  # FieldOptions} for this {FieldDescriptor}.
  # 
  # @return [FieldOptions]
  def options; end

  # Returns the
  # {https://github.com/protocolbuffers/protobuf/blob/v30.2/src/google/protobuf/descriptor.proto#L236
  # FieldDescriptorProto} of this {FieldDescriptor}.
  # 
  # @return [FieldDescriptorProto]
  def to_proto; end

  # Returns whether this field tracks presence.
  # 
  # @return [Boolean]
  def self.has_presence?; end

  # Returns whether the value is set on the given message. Raises an
  # exception when calling for fields that do not have presence.
  # 
  # @param message [AbstractMessage]
  # @return [Boolean]
  def self.has?(message); end

end # class Google::Protobuf::FieldDescriptor
