EnumValue.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: google/protobuf/type.proto
  4. namespace Google\Protobuf;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * Enum value definition.
  10. *
  11. * Generated from protobuf message <code>google.protobuf.EnumValue</code>
  12. */
  13. class EnumValue extends \Google\Protobuf\Internal\Message
  14. {
  15. /**
  16. * Enum value name.
  17. *
  18. * Generated from protobuf field <code>string name = 1;</code>
  19. */
  20. private $name = '';
  21. /**
  22. * Enum value number.
  23. *
  24. * Generated from protobuf field <code>int32 number = 2;</code>
  25. */
  26. private $number = 0;
  27. /**
  28. * Protocol buffer options.
  29. *
  30. * Generated from protobuf field <code>repeated .google.protobuf.Option options = 3;</code>
  31. */
  32. private $options;
  33. /**
  34. * Constructor.
  35. *
  36. * @param array $data {
  37. * Optional. Data for populating the Message object.
  38. *
  39. * @type string $name
  40. * Enum value name.
  41. * @type int $number
  42. * Enum value number.
  43. * @type \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $options
  44. * Protocol buffer options.
  45. * }
  46. */
  47. public function __construct($data = NULL) {
  48. \GPBMetadata\Google\Protobuf\Type::initOnce();
  49. parent::__construct($data);
  50. }
  51. /**
  52. * Enum value name.
  53. *
  54. * Generated from protobuf field <code>string name = 1;</code>
  55. * @return string
  56. */
  57. public function getName()
  58. {
  59. return $this->name;
  60. }
  61. /**
  62. * Enum value name.
  63. *
  64. * Generated from protobuf field <code>string name = 1;</code>
  65. * @param string $var
  66. * @return $this
  67. */
  68. public function setName($var)
  69. {
  70. GPBUtil::checkString($var, True);
  71. $this->name = $var;
  72. return $this;
  73. }
  74. /**
  75. * Enum value number.
  76. *
  77. * Generated from protobuf field <code>int32 number = 2;</code>
  78. * @return int
  79. */
  80. public function getNumber()
  81. {
  82. return $this->number;
  83. }
  84. /**
  85. * Enum value number.
  86. *
  87. * Generated from protobuf field <code>int32 number = 2;</code>
  88. * @param int $var
  89. * @return $this
  90. */
  91. public function setNumber($var)
  92. {
  93. GPBUtil::checkInt32($var);
  94. $this->number = $var;
  95. return $this;
  96. }
  97. /**
  98. * Protocol buffer options.
  99. *
  100. * Generated from protobuf field <code>repeated .google.protobuf.Option options = 3;</code>
  101. * @return \Google\Protobuf\Internal\RepeatedField
  102. */
  103. public function getOptions()
  104. {
  105. return $this->options;
  106. }
  107. /**
  108. * Protocol buffer options.
  109. *
  110. * Generated from protobuf field <code>repeated .google.protobuf.Option options = 3;</code>
  111. * @param \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $var
  112. * @return $this
  113. */
  114. public function setOptions($var)
  115. {
  116. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class);
  117. $this->options = $arr;
  118. return $this;
  119. }
  120. }