OneofDescriptorProto.php 2.58 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
<?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;
12
use Google\Protobuf\Internal\GPBWrapperUtils;
13 14 15 16

/**
 * Describes a oneof.
 *
17
 * Generated from protobuf message <code>google.protobuf.OneofDescriptorProto</code>
18 19 20 21
 */
class OneofDescriptorProto extends \Google\Protobuf\Internal\Message
{
    /**
22
     * Generated from protobuf field <code>optional string name = 1;</code>
23 24 25 26
     */
    private $name = '';
    private $has_name = false;
    /**
27
     * Generated from protobuf field <code>optional .google.protobuf.OneofOptions options = 2;</code>
28 29 30 31
     */
    private $options = null;
    private $has_options = false;

32 33 34 35 36 37 38 39 40 41 42
    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *     @type \Google\Protobuf\Internal\OneofOptions $options
     * }
     */
    public function __construct($data = NULL) {
43
        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
44
        parent::__construct($data);
45 46 47
    }

    /**
48 49
     * Generated from protobuf field <code>optional string name = 1;</code>
     * @return string
50 51 52 53 54 55 56
     */
    public function getName()
    {
        return $this->name;
    }

    /**
57 58 59
     * Generated from protobuf field <code>optional string name = 1;</code>
     * @param string $var
     * @return $this
60 61 62 63 64 65
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;
        $this->has_name = true;
66 67

        return $this;
68 69 70 71 72 73 74 75
    }

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

    /**
76 77
     * Generated from protobuf field <code>optional .google.protobuf.OneofOptions options = 2;</code>
     * @return \Google\Protobuf\Internal\OneofOptions
78 79 80 81 82 83 84
     */
    public function getOptions()
    {
        return $this->options;
    }

    /**
85 86 87
     * Generated from protobuf field <code>optional .google.protobuf.OneofOptions options = 2;</code>
     * @param \Google\Protobuf\Internal\OneofOptions $var
     * @return $this
88
     */
89
    public function setOptions($var)
90 91 92 93
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Internal\OneofOptions::class);
        $this->options = $var;
        $this->has_options = true;
94 95

        return $this;
96 97 98 99 100 101 102 103 104
    }

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

}