DescriptorProto.php 11.2 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 a message type.
 *
16
 * Generated from protobuf message <code>google.protobuf.DescriptorProto</code>
17 18 19 20
 */
class DescriptorProto 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.FieldDescriptorProto field = 2;</code>
27 28 29 30
     */
    private $field;
    private $has_field = false;
    /**
31
     * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto extension = 6;</code>
32 33 34 35
     */
    private $extension;
    private $has_extension = false;
    /**
36
     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto nested_type = 3;</code>
37 38 39 40
     */
    private $nested_type;
    private $has_nested_type = false;
    /**
41
     * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto enum_type = 4;</code>
42 43 44 45
     */
    private $enum_type;
    private $has_enum_type = false;
    /**
46
     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;</code>
47 48 49 50
     */
    private $extension_range;
    private $has_extension_range = false;
    /**
51
     * Generated from protobuf field <code>repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;</code>
52 53 54 55
     */
    private $oneof_decl;
    private $has_oneof_decl = false;
    /**
56
     * Generated from protobuf field <code>optional .google.protobuf.MessageOptions options = 7;</code>
57 58 59 60
     */
    private $options = null;
    private $has_options = false;
    /**
61
     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;</code>
62 63 64 65 66 67 68
     */
    private $reserved_range;
    private $has_reserved_range = false;
    /**
     * Reserved field names, which may not be used by fields in the same message.
     * A given name may only be reserved once.
     *
69
     * Generated from protobuf field <code>repeated string reserved_name = 10;</code>
70 71 72 73 74 75 76 77 78 79
     */
    private $reserved_name;
    private $has_reserved_name = false;

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

    /**
80 81
     * Generated from protobuf field <code>optional string name = 1;</code>
     * @return string
82 83 84 85 86 87 88
     */
    public function getName()
    {
        return $this->name;
    }

    /**
89 90 91
     * Generated from protobuf field <code>optional string name = 1;</code>
     * @param string $var
     * @return $this
92 93 94 95 96 97
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;
        $this->has_name = true;
98 99

        return $this;
100 101 102 103 104 105 106 107
    }

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

    /**
108 109
     * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto field = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
110 111 112 113 114 115 116
     */
    public function getField()
    {
        return $this->field;
    }

    /**
117 118 119
     * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto field = 2;</code>
     * @param \Google\Protobuf\Internal\FieldDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
120
     */
121
    public function setField($var)
122
    {
123 124
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class);
        $this->field = $arr;
125
        $this->has_field = true;
126 127

        return $this;
128 129 130 131 132 133 134 135
    }

    public function hasField()
    {
        return $this->has_field;
    }

    /**
136 137
     * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto extension = 6;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
138 139 140 141 142 143 144
     */
    public function getExtension()
    {
        return $this->extension;
    }

    /**
145 146 147
     * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto extension = 6;</code>
     * @param \Google\Protobuf\Internal\FieldDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
148
     */
149
    public function setExtension($var)
150
    {
151 152
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class);
        $this->extension = $arr;
153
        $this->has_extension = true;
154 155

        return $this;
156 157 158 159 160 161 162 163
    }

    public function hasExtension()
    {
        return $this->has_extension;
    }

    /**
164 165
     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto nested_type = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
166 167 168 169 170 171 172
     */
    public function getNestedType()
    {
        return $this->nested_type;
    }

    /**
173 174 175
     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto nested_type = 3;</code>
     * @param \Google\Protobuf\Internal\DescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
176
     */
177
    public function setNestedType($var)
178
    {
179 180
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto::class);
        $this->nested_type = $arr;
181
        $this->has_nested_type = true;
182 183

        return $this;
184 185 186 187 188 189 190 191
    }

    public function hasNestedType()
    {
        return $this->has_nested_type;
    }

    /**
192 193
     * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto enum_type = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
194 195 196 197 198 199 200
     */
    public function getEnumType()
    {
        return $this->enum_type;
    }

    /**
201 202 203
     * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto enum_type = 4;</code>
     * @param \Google\Protobuf\Internal\EnumDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
204
     */
205
    public function setEnumType($var)
206
    {
207 208
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto::class);
        $this->enum_type = $arr;
209
        $this->has_enum_type = true;
210 211

        return $this;
212 213 214 215 216 217 218 219
    }

    public function hasEnumType()
    {
        return $this->has_enum_type;
    }

    /**
220 221
     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
222 223 224 225 226 227 228
     */
    public function getExtensionRange()
    {
        return $this->extension_range;
    }

    /**
229 230 231
     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;</code>
     * @param \Google\Protobuf\Internal\DescriptorProto_ExtensionRange[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
232
     */
233
    public function setExtensionRange($var)
234
    {
235 236
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto_ExtensionRange::class);
        $this->extension_range = $arr;
237
        $this->has_extension_range = true;
238 239

        return $this;
240 241 242 243 244 245 246 247
    }

    public function hasExtensionRange()
    {
        return $this->has_extension_range;
    }

    /**
248 249
     * Generated from protobuf field <code>repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
250 251 252 253 254 255 256
     */
    public function getOneofDecl()
    {
        return $this->oneof_decl;
    }

    /**
257 258 259
     * Generated from protobuf field <code>repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;</code>
     * @param \Google\Protobuf\Internal\OneofDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
260
     */
261
    public function setOneofDecl($var)
262
    {
263 264
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\OneofDescriptorProto::class);
        $this->oneof_decl = $arr;
265
        $this->has_oneof_decl = true;
266 267

        return $this;
268 269 270 271 272 273 274 275
    }

    public function hasOneofDecl()
    {
        return $this->has_oneof_decl;
    }

    /**
276 277
     * Generated from protobuf field <code>optional .google.protobuf.MessageOptions options = 7;</code>
     * @return \Google\Protobuf\Internal\MessageOptions
278 279 280 281 282 283 284
     */
    public function getOptions()
    {
        return $this->options;
    }

    /**
285 286 287
     * Generated from protobuf field <code>optional .google.protobuf.MessageOptions options = 7;</code>
     * @param \Google\Protobuf\Internal\MessageOptions $var
     * @return $this
288
     */
289
    public function setOptions($var)
290 291 292 293
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Internal\MessageOptions::class);
        $this->options = $var;
        $this->has_options = true;
294 295

        return $this;
296 297 298 299 300 301 302 303
    }

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

    /**
304 305
     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
306 307 308 309 310 311 312
     */
    public function getReservedRange()
    {
        return $this->reserved_range;
    }

    /**
313 314 315
     * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;</code>
     * @param \Google\Protobuf\Internal\DescriptorProto_ReservedRange[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
316
     */
317
    public function setReservedRange($var)
318
    {
319 320
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto_ReservedRange::class);
        $this->reserved_range = $arr;
321
        $this->has_reserved_range = true;
322 323

        return $this;
324 325 326 327 328 329 330 331 332 333 334
    }

    public function hasReservedRange()
    {
        return $this->has_reserved_range;
    }

    /**
     * Reserved field names, which may not be used by fields in the same message.
     * A given name may only be reserved once.
     *
335 336
     * Generated from protobuf field <code>repeated string reserved_name = 10;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
337 338 339 340 341 342 343 344 345 346
     */
    public function getReservedName()
    {
        return $this->reserved_name;
    }

    /**
     * Reserved field names, which may not be used by fields in the same message.
     * A given name may only be reserved once.
     *
347 348 349
     * Generated from protobuf field <code>repeated string reserved_name = 10;</code>
     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
350
     */
351
    public function setReservedName($var)
352
    {
353 354
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->reserved_name = $arr;
355
        $this->has_reserved_name = true;
356 357

        return $this;
358 359 360 361 362 363 364 365 366
    }

    public function hasReservedName()
    {
        return $this->has_reserved_name;
    }

}