<?php
 
 
 

namespace Google\Protobuf;

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






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




    protected $kind = 0;
    




    protected $cardinality = 0;
    




    protected $number = 0;
    




    protected $name = '';
    





    protected $type_url = '';
    





    protected $oneof_index = 0;
    




    protected $packed = false;
    




    private $options;
    




    protected $json_name = '';
    




    protected $default_value = '';

    





























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

    





    public function getKind()
    {
        return $this->kind;
    }

    






    public function setKind($var)
    {
        GPBUtil::checkEnum($var, \Google\Protobuf\Field\Kind::class);
        $this->kind = $var;

        return $this;
    }

    





    public function getCardinality()
    {
        return $this->cardinality;
    }

    






    public function setCardinality($var)
    {
        GPBUtil::checkEnum($var, \Google\Protobuf\Field\Cardinality::class);
        $this->cardinality = $var;

        return $this;
    }

    





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

    






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

        return $this;
    }

    





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

    






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

        return $this;
    }

    






    public function getTypeUrl()
    {
        return $this->type_url;
    }

    







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

        return $this;
    }

    






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

    







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

        return $this;
    }

    





    public function getPacked()
    {
        return $this->packed;
    }

    






    public function setPacked($var)
    {
        GPBUtil::checkBool($var);
        $this->packed = $var;

        return $this;
    }

    





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

    






    public function setOptions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
        $this->options = $arr;

        return $this;
    }

    





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

    






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

        return $this;
    }

    





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

    






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

        return $this;
    }

}

