<?php
 
 
 

namespace Google\Protobuf\Internal;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBWire;
use Google\Protobuf\Internal\InputStream;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;






class FieldDescriptorProto extends \Google\Protobuf\Internal\Message
{
    


    protected $name = null;
    


    protected $number = null;
    


    protected $label = null;
    





    protected $type = null;
    








    protected $type_name = null;
    





    protected $extendee = null;
    







    protected $default_value = null;
    





    protected $oneof_index = null;
    







    protected $json_name = null;
    


    protected $options = null;
    





















    protected $proto3_optional = null;

    























































    public function __construct($data = NULL) {
        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
        parent::__construct($data);
    }

    



    public function getName()
    {
        return isset($this->name) ? $this->name : '';
    }

    public function hasName()
    {
        return isset($this->name);
    }

    public function clearName()
    {
        unset($this->name);
    }

    




    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    



    public function getNumber()
    {
        return isset($this->number) ? $this->number : 0;
    }

    public function hasNumber()
    {
        return isset($this->number);
    }

    public function clearNumber()
    {
        unset($this->number);
    }

    




    public function setNumber($var)
    {
        GPBUtil::checkInt32($var);
        $this->number = $var;

        return $this;
    }

    



    public function getLabel()
    {
        return isset($this->label) ? $this->label : 0;
    }

    public function hasLabel()
    {
        return isset($this->label);
    }

    public function clearLabel()
    {
        unset($this->label);
    }

    




    public function setLabel($var)
    {
        GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldDescriptorProto\Label::class);
        $this->label = $var;

        return $this;
    }

    






    public function getType()
    {
        return isset($this->type) ? $this->type : 0;
    }

    public function hasType()
    {
        return isset($this->type);
    }

    public function clearType()
    {
        unset($this->type);
    }

    







    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldDescriptorProto\Type::class);
        $this->type = $var;

        return $this;
    }

    









    public function getTypeName()
    {
        return isset($this->type_name) ? $this->type_name : '';
    }

    public function hasTypeName()
    {
        return isset($this->type_name);
    }

    public function clearTypeName()
    {
        unset($this->type_name);
    }

    










    public function setTypeName($var)
    {
        GPBUtil::checkString($var, True);
        $this->type_name = $var;

        return $this;
    }

    






    public function getExtendee()
    {
        return isset($this->extendee) ? $this->extendee : '';
    }

    public function hasExtendee()
    {
        return isset($this->extendee);
    }

    public function clearExtendee()
    {
        unset($this->extendee);
    }

    







    public function setExtendee($var)
    {
        GPBUtil::checkString($var, True);
        $this->extendee = $var;

        return $this;
    }

    








    public function getDefaultValue()
    {
        return isset($this->default_value) ? $this->default_value : '';
    }

    public function hasDefaultValue()
    {
        return isset($this->default_value);
    }

    public function clearDefaultValue()
    {
        unset($this->default_value);
    }

    









    public function setDefaultValue($var)
    {
        GPBUtil::checkString($var, True);
        $this->default_value = $var;

        return $this;
    }

    






    public function getOneofIndex()
    {
        return isset($this->oneof_index) ? $this->oneof_index : 0;
    }

    public function hasOneofIndex()
    {
        return isset($this->oneof_index);
    }

    public function clearOneofIndex()
    {
        unset($this->oneof_index);
    }

    







    public function setOneofIndex($var)
    {
        GPBUtil::checkInt32($var);
        $this->oneof_index = $var;

        return $this;
    }

    








    public function getJsonName()
    {
        return isset($this->json_name) ? $this->json_name : '';
    }

    public function hasJsonName()
    {
        return isset($this->json_name);
    }

    public function clearJsonName()
    {
        unset($this->json_name);
    }

    









    public function setJsonName($var)
    {
        GPBUtil::checkString($var, True);
        $this->json_name = $var;

        return $this;
    }

    



    public function getOptions()
    {
        return $this->options;
    }

    public function hasOptions()
    {
        return isset($this->options);
    }

    public function clearOptions()
    {
        unset($this->options);
    }

    




    public function setOptions($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FieldOptions::class);
        $this->options = $var;

        return $this;
    }

    






















    public function getProto3Optional()
    {
        return isset($this->proto3_optional) ? $this->proto3_optional : false;
    }

    public function hasProto3Optional()
    {
        return isset($this->proto3_optional);
    }

    public function clearProto3Optional()
    {
        unset($this->proto3_optional);
    }

    























    public function setProto3Optional($var)
    {
        GPBUtil::checkBool($var);
        $this->proto3_optional = $var;

        return $this;
    }

}

