EnumDescriptorProto.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: google/protobuf/descriptor.proto
  4. namespace Google\Protobuf\Internal;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\GPBWire;
  7. use Google\Protobuf\Internal\RepeatedField;
  8. use Google\Protobuf\Internal\InputStream;
  9. use Google\Protobuf\Internal\GPBUtil;
  10. /**
  11. * Describes an enum type.
  12. *
  13. * Generated from protobuf message <code>google.protobuf.EnumDescriptorProto</code>
  14. */
  15. class EnumDescriptorProto extends \Google\Protobuf\Internal\Message
  16. {
  17. /**
  18. * Generated from protobuf field <code>optional string name = 1;</code>
  19. */
  20. protected $name = '';
  21. private $has_name = false;
  22. /**
  23. * Generated from protobuf field <code>repeated .google.protobuf.EnumValueDescriptorProto value = 2;</code>
  24. */
  25. private $value;
  26. private $has_value = false;
  27. /**
  28. * Generated from protobuf field <code>optional .google.protobuf.EnumOptions options = 3;</code>
  29. */
  30. protected $options = null;
  31. private $has_options = false;
  32. /**
  33. * Range of reserved numeric values. Reserved numeric values may not be used
  34. * by enum values in the same enum declaration. Reserved ranges may not
  35. * overlap.
  36. *
  37. * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;</code>
  38. */
  39. private $reserved_range;
  40. private $has_reserved_range = false;
  41. /**
  42. * Reserved enum value names, which may not be reused. A given name may only
  43. * be reserved once.
  44. *
  45. * Generated from protobuf field <code>repeated string reserved_name = 5;</code>
  46. */
  47. private $reserved_name;
  48. private $has_reserved_name = false;
  49. /**
  50. * Constructor.
  51. *
  52. * @param array $data {
  53. * Optional. Data for populating the Message object.
  54. *
  55. * @type string $name
  56. * @type \Google\Protobuf\Internal\EnumValueDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $value
  57. * @type \Google\Protobuf\Internal\EnumOptions $options
  58. * @type \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange[]|\Google\Protobuf\Internal\RepeatedField $reserved_range
  59. * Range of reserved numeric values. Reserved numeric values may not be used
  60. * by enum values in the same enum declaration. Reserved ranges may not
  61. * overlap.
  62. * @type string[]|\Google\Protobuf\Internal\RepeatedField $reserved_name
  63. * Reserved enum value names, which may not be reused. A given name may only
  64. * be reserved once.
  65. * }
  66. */
  67. public function __construct($data = NULL) {
  68. \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
  69. parent::__construct($data);
  70. }
  71. /**
  72. * Generated from protobuf field <code>optional string name = 1;</code>
  73. * @return string
  74. */
  75. public function getName()
  76. {
  77. return $this->name;
  78. }
  79. /**
  80. * Generated from protobuf field <code>optional string name = 1;</code>
  81. * @param string $var
  82. * @return $this
  83. */
  84. public function setName($var)
  85. {
  86. GPBUtil::checkString($var, True);
  87. $this->name = $var;
  88. $this->has_name = true;
  89. return $this;
  90. }
  91. public function hasName()
  92. {
  93. return $this->has_name;
  94. }
  95. /**
  96. * Generated from protobuf field <code>repeated .google.protobuf.EnumValueDescriptorProto value = 2;</code>
  97. * @return \Google\Protobuf\Internal\RepeatedField
  98. */
  99. public function getValue()
  100. {
  101. return $this->value;
  102. }
  103. /**
  104. * Generated from protobuf field <code>repeated .google.protobuf.EnumValueDescriptorProto value = 2;</code>
  105. * @param \Google\Protobuf\Internal\EnumValueDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
  106. * @return $this
  107. */
  108. public function setValue($var)
  109. {
  110. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumValueDescriptorProto::class);
  111. $this->value = $arr;
  112. $this->has_value = true;
  113. return $this;
  114. }
  115. public function hasValue()
  116. {
  117. return $this->has_value;
  118. }
  119. /**
  120. * Generated from protobuf field <code>optional .google.protobuf.EnumOptions options = 3;</code>
  121. * @return \Google\Protobuf\Internal\EnumOptions
  122. */
  123. public function getOptions()
  124. {
  125. return $this->options;
  126. }
  127. /**
  128. * Generated from protobuf field <code>optional .google.protobuf.EnumOptions options = 3;</code>
  129. * @param \Google\Protobuf\Internal\EnumOptions $var
  130. * @return $this
  131. */
  132. public function setOptions($var)
  133. {
  134. GPBUtil::checkMessage($var, \Google\Protobuf\Internal\EnumOptions::class);
  135. $this->options = $var;
  136. $this->has_options = true;
  137. return $this;
  138. }
  139. public function hasOptions()
  140. {
  141. return $this->has_options;
  142. }
  143. /**
  144. * Range of reserved numeric values. Reserved numeric values may not be used
  145. * by enum values in the same enum declaration. Reserved ranges may not
  146. * overlap.
  147. *
  148. * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;</code>
  149. * @return \Google\Protobuf\Internal\RepeatedField
  150. */
  151. public function getReservedRange()
  152. {
  153. return $this->reserved_range;
  154. }
  155. /**
  156. * Range of reserved numeric values. Reserved numeric values may not be used
  157. * by enum values in the same enum declaration. Reserved ranges may not
  158. * overlap.
  159. *
  160. * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;</code>
  161. * @param \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange[]|\Google\Protobuf\Internal\RepeatedField $var
  162. * @return $this
  163. */
  164. public function setReservedRange($var)
  165. {
  166. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange::class);
  167. $this->reserved_range = $arr;
  168. $this->has_reserved_range = true;
  169. return $this;
  170. }
  171. public function hasReservedRange()
  172. {
  173. return $this->has_reserved_range;
  174. }
  175. /**
  176. * Reserved enum value names, which may not be reused. A given name may only
  177. * be reserved once.
  178. *
  179. * Generated from protobuf field <code>repeated string reserved_name = 5;</code>
  180. * @return \Google\Protobuf\Internal\RepeatedField
  181. */
  182. public function getReservedName()
  183. {
  184. return $this->reserved_name;
  185. }
  186. /**
  187. * Reserved enum value names, which may not be reused. A given name may only
  188. * be reserved once.
  189. *
  190. * Generated from protobuf field <code>repeated string reserved_name = 5;</code>
  191. * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
  192. * @return $this
  193. */
  194. public function setReservedName($var)
  195. {
  196. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
  197. $this->reserved_name = $arr;
  198. $this->has_reserved_name = true;
  199. return $this;
  200. }
  201. public function hasReservedName()
  202. {
  203. return $this->has_reserved_name;
  204. }
  205. }