EnumDescriptorProto.php 3.31 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/protobuf/descriptor.proto

namespace Google\Protobuf\Internal;

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

/**
 * Describes an enum type.
 *
16
 * Generated from protobuf message <code>google.protobuf.EnumDescriptorProto</code>
17 18 19 20
 */
class EnumDescriptorProto extends \Google\Protobuf\Internal\Message
{
    /**
21
     * Generated from protobuf field <code>optional string name = 1;</code>
22 23 24 25
     */
    private $name = '';
    private $has_name = false;
    /**
26
     * Generated from protobuf field <code>repeated .google.protobuf.EnumValueDescriptorProto value = 2;</code>
27 28 29 30
     */
    private $value;
    private $has_value = false;
    /**
31
     * Generated from protobuf field <code>optional .google.protobuf.EnumOptions options = 3;</code>
32 33 34 35 36 37 38 39 40 41
     */
    private $options = null;
    private $has_options = false;

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

    /**
42 43
     * Generated from protobuf field <code>optional string name = 1;</code>
     * @return string
44 45 46 47 48 49 50
     */
    public function getName()
    {
        return $this->name;
    }

    /**
51 52 53
     * Generated from protobuf field <code>optional string name = 1;</code>
     * @param string $var
     * @return $this
54 55 56 57 58 59
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;
        $this->has_name = true;
60 61

        return $this;
62 63 64 65 66 67 68 69
    }

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

    /**
70 71
     * Generated from protobuf field <code>repeated .google.protobuf.EnumValueDescriptorProto value = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
72 73 74 75 76 77 78
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
79 80 81
     * Generated from protobuf field <code>repeated .google.protobuf.EnumValueDescriptorProto value = 2;</code>
     * @param \Google\Protobuf\Internal\EnumValueDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
82
     */
83
    public function setValue($var)
84
    {
85 86
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumValueDescriptorProto::class);
        $this->value = $arr;
87
        $this->has_value = true;
88 89

        return $this;
90 91 92 93 94 95 96 97
    }

    public function hasValue()
    {
        return $this->has_value;
    }

    /**
98 99
     * Generated from protobuf field <code>optional .google.protobuf.EnumOptions options = 3;</code>
     * @return \Google\Protobuf\Internal\EnumOptions
100 101 102 103 104 105 106
     */
    public function getOptions()
    {
        return $this->options;
    }

    /**
107 108 109
     * Generated from protobuf field <code>optional .google.protobuf.EnumOptions options = 3;</code>
     * @param \Google\Protobuf\Internal\EnumOptions $var
     * @return $this
110
     */
111
    public function setOptions($var)
112 113 114 115
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Internal\EnumOptions::class);
        $this->options = $var;
        $this->has_options = true;
116 117

        return $this;
118 119 120 121 122 123 124 125 126
    }

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

}