DescriptorProto.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  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 a message type.
  12. *
  13. * Generated from protobuf message <code>google.protobuf.DescriptorProto</code>
  14. */
  15. class DescriptorProto extends \Google\Protobuf\Internal\Message
  16. {
  17. /**
  18. * Generated from protobuf field <code>optional string name = 1;</code>
  19. */
  20. protected $name = null;
  21. /**
  22. * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto field = 2;</code>
  23. */
  24. private $field;
  25. /**
  26. * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto extension = 6;</code>
  27. */
  28. private $extension;
  29. /**
  30. * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto nested_type = 3;</code>
  31. */
  32. private $nested_type;
  33. /**
  34. * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto enum_type = 4;</code>
  35. */
  36. private $enum_type;
  37. /**
  38. * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;</code>
  39. */
  40. private $extension_range;
  41. /**
  42. * Generated from protobuf field <code>repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;</code>
  43. */
  44. private $oneof_decl;
  45. /**
  46. * Generated from protobuf field <code>optional .google.protobuf.MessageOptions options = 7;</code>
  47. */
  48. protected $options = null;
  49. /**
  50. * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;</code>
  51. */
  52. private $reserved_range;
  53. /**
  54. * Reserved field names, which may not be used by fields in the same message.
  55. * A given name may only be reserved once.
  56. *
  57. * Generated from protobuf field <code>repeated string reserved_name = 10;</code>
  58. */
  59. private $reserved_name;
  60. /**
  61. * Constructor.
  62. *
  63. * @param array $data {
  64. * Optional. Data for populating the Message object.
  65. *
  66. * @type string $name
  67. * @type \Google\Protobuf\Internal\FieldDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $field
  68. * @type \Google\Protobuf\Internal\FieldDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $extension
  69. * @type \Google\Protobuf\Internal\DescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $nested_type
  70. * @type \Google\Protobuf\Internal\EnumDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $enum_type
  71. * @type \Google\Protobuf\Internal\DescriptorProto\ExtensionRange[]|\Google\Protobuf\Internal\RepeatedField $extension_range
  72. * @type \Google\Protobuf\Internal\OneofDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $oneof_decl
  73. * @type \Google\Protobuf\Internal\MessageOptions $options
  74. * @type \Google\Protobuf\Internal\DescriptorProto\ReservedRange[]|\Google\Protobuf\Internal\RepeatedField $reserved_range
  75. * @type string[]|\Google\Protobuf\Internal\RepeatedField $reserved_name
  76. * Reserved field names, which may not be used by fields in the same message.
  77. * A given name may only be reserved once.
  78. * }
  79. */
  80. public function __construct($data = NULL) {
  81. \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
  82. parent::__construct($data);
  83. }
  84. /**
  85. * Generated from protobuf field <code>optional string name = 1;</code>
  86. * @return string
  87. */
  88. public function getName()
  89. {
  90. return isset($this->name) ? $this->name : '';
  91. }
  92. public function hasName()
  93. {
  94. return isset($this->name);
  95. }
  96. public function clearName()
  97. {
  98. unset($this->name);
  99. }
  100. /**
  101. * Generated from protobuf field <code>optional string name = 1;</code>
  102. * @param string $var
  103. * @return $this
  104. */
  105. public function setName($var)
  106. {
  107. GPBUtil::checkString($var, True);
  108. $this->name = $var;
  109. return $this;
  110. }
  111. /**
  112. * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto field = 2;</code>
  113. * @return \Google\Protobuf\Internal\RepeatedField
  114. */
  115. public function getField()
  116. {
  117. return $this->field;
  118. }
  119. /**
  120. * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto field = 2;</code>
  121. * @param \Google\Protobuf\Internal\FieldDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
  122. * @return $this
  123. */
  124. public function setField($var)
  125. {
  126. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class);
  127. $this->field = $arr;
  128. return $this;
  129. }
  130. /**
  131. * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto extension = 6;</code>
  132. * @return \Google\Protobuf\Internal\RepeatedField
  133. */
  134. public function getExtension()
  135. {
  136. return $this->extension;
  137. }
  138. /**
  139. * Generated from protobuf field <code>repeated .google.protobuf.FieldDescriptorProto extension = 6;</code>
  140. * @param \Google\Protobuf\Internal\FieldDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
  141. * @return $this
  142. */
  143. public function setExtension($var)
  144. {
  145. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FieldDescriptorProto::class);
  146. $this->extension = $arr;
  147. return $this;
  148. }
  149. /**
  150. * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto nested_type = 3;</code>
  151. * @return \Google\Protobuf\Internal\RepeatedField
  152. */
  153. public function getNestedType()
  154. {
  155. return $this->nested_type;
  156. }
  157. /**
  158. * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto nested_type = 3;</code>
  159. * @param \Google\Protobuf\Internal\DescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
  160. * @return $this
  161. */
  162. public function setNestedType($var)
  163. {
  164. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto::class);
  165. $this->nested_type = $arr;
  166. return $this;
  167. }
  168. /**
  169. * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto enum_type = 4;</code>
  170. * @return \Google\Protobuf\Internal\RepeatedField
  171. */
  172. public function getEnumType()
  173. {
  174. return $this->enum_type;
  175. }
  176. /**
  177. * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto enum_type = 4;</code>
  178. * @param \Google\Protobuf\Internal\EnumDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
  179. * @return $this
  180. */
  181. public function setEnumType($var)
  182. {
  183. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto::class);
  184. $this->enum_type = $arr;
  185. return $this;
  186. }
  187. /**
  188. * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;</code>
  189. * @return \Google\Protobuf\Internal\RepeatedField
  190. */
  191. public function getExtensionRange()
  192. {
  193. return $this->extension_range;
  194. }
  195. /**
  196. * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ExtensionRange extension_range = 5;</code>
  197. * @param \Google\Protobuf\Internal\DescriptorProto\ExtensionRange[]|\Google\Protobuf\Internal\RepeatedField $var
  198. * @return $this
  199. */
  200. public function setExtensionRange($var)
  201. {
  202. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto\ExtensionRange::class);
  203. $this->extension_range = $arr;
  204. return $this;
  205. }
  206. /**
  207. * Generated from protobuf field <code>repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;</code>
  208. * @return \Google\Protobuf\Internal\RepeatedField
  209. */
  210. public function getOneofDecl()
  211. {
  212. return $this->oneof_decl;
  213. }
  214. /**
  215. * Generated from protobuf field <code>repeated .google.protobuf.OneofDescriptorProto oneof_decl = 8;</code>
  216. * @param \Google\Protobuf\Internal\OneofDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
  217. * @return $this
  218. */
  219. public function setOneofDecl($var)
  220. {
  221. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\OneofDescriptorProto::class);
  222. $this->oneof_decl = $arr;
  223. return $this;
  224. }
  225. /**
  226. * Generated from protobuf field <code>optional .google.protobuf.MessageOptions options = 7;</code>
  227. * @return \Google\Protobuf\Internal\MessageOptions
  228. */
  229. public function getOptions()
  230. {
  231. return isset($this->options) ? $this->options : null;
  232. }
  233. public function hasOptions()
  234. {
  235. return isset($this->options);
  236. }
  237. public function clearOptions()
  238. {
  239. unset($this->options);
  240. }
  241. /**
  242. * Generated from protobuf field <code>optional .google.protobuf.MessageOptions options = 7;</code>
  243. * @param \Google\Protobuf\Internal\MessageOptions $var
  244. * @return $this
  245. */
  246. public function setOptions($var)
  247. {
  248. GPBUtil::checkMessage($var, \Google\Protobuf\Internal\MessageOptions::class);
  249. $this->options = $var;
  250. return $this;
  251. }
  252. /**
  253. * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;</code>
  254. * @return \Google\Protobuf\Internal\RepeatedField
  255. */
  256. public function getReservedRange()
  257. {
  258. return $this->reserved_range;
  259. }
  260. /**
  261. * Generated from protobuf field <code>repeated .google.protobuf.DescriptorProto.ReservedRange reserved_range = 9;</code>
  262. * @param \Google\Protobuf\Internal\DescriptorProto\ReservedRange[]|\Google\Protobuf\Internal\RepeatedField $var
  263. * @return $this
  264. */
  265. public function setReservedRange($var)
  266. {
  267. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\DescriptorProto\ReservedRange::class);
  268. $this->reserved_range = $arr;
  269. return $this;
  270. }
  271. /**
  272. * Reserved field names, which may not be used by fields in the same message.
  273. * A given name may only be reserved once.
  274. *
  275. * Generated from protobuf field <code>repeated string reserved_name = 10;</code>
  276. * @return \Google\Protobuf\Internal\RepeatedField
  277. */
  278. public function getReservedName()
  279. {
  280. return $this->reserved_name;
  281. }
  282. /**
  283. * Reserved field names, which may not be used by fields in the same message.
  284. * A given name may only be reserved once.
  285. *
  286. * Generated from protobuf field <code>repeated string reserved_name = 10;</code>
  287. * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
  288. * @return $this
  289. */
  290. public function setReservedName($var)
  291. {
  292. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
  293. $this->reserved_name = $arr;
  294. return $this;
  295. }
  296. }