FieldOptions.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  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. * Generated from protobuf message <code>google.protobuf.FieldOptions</code>
  12. */
  13. class FieldOptions extends \Google\Protobuf\Internal\Message
  14. {
  15. /**
  16. * The ctype option instructs the C++ code generator to use a different
  17. * representation of the field than it normally would. See the specific
  18. * options below. This option is not yet implemented in the open source
  19. * release -- sorry, we'll try to include it in a future version!
  20. *
  21. * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];</code>
  22. */
  23. protected $ctype = 0;
  24. private $has_ctype = false;
  25. /**
  26. * The packed option can be enabled for repeated primitive fields to enable
  27. * a more efficient representation on the wire. Rather than repeatedly
  28. * writing the tag and type for each element, the entire array is encoded as
  29. * a single length-delimited blob. In proto3, only explicit setting it to
  30. * false will avoid using packed encoding.
  31. *
  32. * Generated from protobuf field <code>optional bool packed = 2;</code>
  33. */
  34. protected $packed = false;
  35. private $has_packed = false;
  36. /**
  37. * The jstype option determines the JavaScript type used for values of the
  38. * field. The option is permitted only for 64 bit integral and fixed types
  39. * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
  40. * is represented as JavaScript string, which avoids loss of precision that
  41. * can happen when a large value is converted to a floating point JavaScript.
  42. * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
  43. * use the JavaScript "number" type. The behavior of the default option
  44. * JS_NORMAL is implementation dependent.
  45. * This option is an enum to permit additional types to be added, e.g.
  46. * goog.math.Integer.
  47. *
  48. * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];</code>
  49. */
  50. protected $jstype = 0;
  51. private $has_jstype = false;
  52. /**
  53. * Should this field be parsed lazily? Lazy applies only to message-type
  54. * fields. It means that when the outer message is initially parsed, the
  55. * inner message's contents will not be parsed but instead stored in encoded
  56. * form. The inner message will actually be parsed when it is first accessed.
  57. * This is only a hint. Implementations are free to choose whether to use
  58. * eager or lazy parsing regardless of the value of this option. However,
  59. * setting this option true suggests that the protocol author believes that
  60. * using lazy parsing on this field is worth the additional bookkeeping
  61. * overhead typically needed to implement it.
  62. * This option does not affect the public interface of any generated code;
  63. * all method signatures remain the same. Furthermore, thread-safety of the
  64. * interface is not affected by this option; const methods remain safe to
  65. * call from multiple threads concurrently, while non-const methods continue
  66. * to require exclusive access.
  67. * Note that implementations may choose not to check required fields within
  68. * a lazy sub-message. That is, calling IsInitialized() on the outer message
  69. * may return true even if the inner message has missing required fields.
  70. * This is necessary because otherwise the inner message would have to be
  71. * parsed in order to perform the check, defeating the purpose of lazy
  72. * parsing. An implementation which chooses not to check required fields
  73. * must be consistent about it. That is, for any particular sub-message, the
  74. * implementation must either *always* check its required fields, or *never*
  75. * check its required fields, regardless of whether or not the message has
  76. * been parsed.
  77. *
  78. * Generated from protobuf field <code>optional bool lazy = 5 [default = false];</code>
  79. */
  80. protected $lazy = false;
  81. private $has_lazy = false;
  82. /**
  83. * Is this field deprecated?
  84. * Depending on the target platform, this can emit Deprecated annotations
  85. * for accessors, or it will be completely ignored; in the very least, this
  86. * is a formalization for deprecating fields.
  87. *
  88. * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
  89. */
  90. protected $deprecated = false;
  91. private $has_deprecated = false;
  92. /**
  93. * For Google-internal migration only. Do not use.
  94. *
  95. * Generated from protobuf field <code>optional bool weak = 10 [default = false];</code>
  96. */
  97. protected $weak = false;
  98. private $has_weak = false;
  99. /**
  100. * The parser stores options it doesn't recognize here. See above.
  101. *
  102. * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
  103. */
  104. private $uninterpreted_option;
  105. private $has_uninterpreted_option = false;
  106. /**
  107. * Constructor.
  108. *
  109. * @param array $data {
  110. * Optional. Data for populating the Message object.
  111. *
  112. * @type int $ctype
  113. * The ctype option instructs the C++ code generator to use a different
  114. * representation of the field than it normally would. See the specific
  115. * options below. This option is not yet implemented in the open source
  116. * release -- sorry, we'll try to include it in a future version!
  117. * @type bool $packed
  118. * The packed option can be enabled for repeated primitive fields to enable
  119. * a more efficient representation on the wire. Rather than repeatedly
  120. * writing the tag and type for each element, the entire array is encoded as
  121. * a single length-delimited blob. In proto3, only explicit setting it to
  122. * false will avoid using packed encoding.
  123. * @type int $jstype
  124. * The jstype option determines the JavaScript type used for values of the
  125. * field. The option is permitted only for 64 bit integral and fixed types
  126. * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
  127. * is represented as JavaScript string, which avoids loss of precision that
  128. * can happen when a large value is converted to a floating point JavaScript.
  129. * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
  130. * use the JavaScript "number" type. The behavior of the default option
  131. * JS_NORMAL is implementation dependent.
  132. * This option is an enum to permit additional types to be added, e.g.
  133. * goog.math.Integer.
  134. * @type bool $lazy
  135. * Should this field be parsed lazily? Lazy applies only to message-type
  136. * fields. It means that when the outer message is initially parsed, the
  137. * inner message's contents will not be parsed but instead stored in encoded
  138. * form. The inner message will actually be parsed when it is first accessed.
  139. * This is only a hint. Implementations are free to choose whether to use
  140. * eager or lazy parsing regardless of the value of this option. However,
  141. * setting this option true suggests that the protocol author believes that
  142. * using lazy parsing on this field is worth the additional bookkeeping
  143. * overhead typically needed to implement it.
  144. * This option does not affect the public interface of any generated code;
  145. * all method signatures remain the same. Furthermore, thread-safety of the
  146. * interface is not affected by this option; const methods remain safe to
  147. * call from multiple threads concurrently, while non-const methods continue
  148. * to require exclusive access.
  149. * Note that implementations may choose not to check required fields within
  150. * a lazy sub-message. That is, calling IsInitialized() on the outer message
  151. * may return true even if the inner message has missing required fields.
  152. * This is necessary because otherwise the inner message would have to be
  153. * parsed in order to perform the check, defeating the purpose of lazy
  154. * parsing. An implementation which chooses not to check required fields
  155. * must be consistent about it. That is, for any particular sub-message, the
  156. * implementation must either *always* check its required fields, or *never*
  157. * check its required fields, regardless of whether or not the message has
  158. * been parsed.
  159. * @type bool $deprecated
  160. * Is this field deprecated?
  161. * Depending on the target platform, this can emit Deprecated annotations
  162. * for accessors, or it will be completely ignored; in the very least, this
  163. * is a formalization for deprecating fields.
  164. * @type bool $weak
  165. * For Google-internal migration only. Do not use.
  166. * @type \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option
  167. * The parser stores options it doesn't recognize here. See above.
  168. * }
  169. */
  170. public function __construct($data = NULL) {
  171. \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
  172. parent::__construct($data);
  173. }
  174. /**
  175. * The ctype option instructs the C++ code generator to use a different
  176. * representation of the field than it normally would. See the specific
  177. * options below. This option is not yet implemented in the open source
  178. * release -- sorry, we'll try to include it in a future version!
  179. *
  180. * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];</code>
  181. * @return int
  182. */
  183. public function getCtype()
  184. {
  185. return $this->ctype;
  186. }
  187. /**
  188. * The ctype option instructs the C++ code generator to use a different
  189. * representation of the field than it normally would. See the specific
  190. * options below. This option is not yet implemented in the open source
  191. * release -- sorry, we'll try to include it in a future version!
  192. *
  193. * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];</code>
  194. * @param int $var
  195. * @return $this
  196. */
  197. public function setCtype($var)
  198. {
  199. GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions\CType::class);
  200. $this->ctype = $var;
  201. $this->has_ctype = true;
  202. return $this;
  203. }
  204. public function hasCtype()
  205. {
  206. return $this->has_ctype;
  207. }
  208. /**
  209. * The packed option can be enabled for repeated primitive fields to enable
  210. * a more efficient representation on the wire. Rather than repeatedly
  211. * writing the tag and type for each element, the entire array is encoded as
  212. * a single length-delimited blob. In proto3, only explicit setting it to
  213. * false will avoid using packed encoding.
  214. *
  215. * Generated from protobuf field <code>optional bool packed = 2;</code>
  216. * @return bool
  217. */
  218. public function getPacked()
  219. {
  220. return $this->packed;
  221. }
  222. /**
  223. * The packed option can be enabled for repeated primitive fields to enable
  224. * a more efficient representation on the wire. Rather than repeatedly
  225. * writing the tag and type for each element, the entire array is encoded as
  226. * a single length-delimited blob. In proto3, only explicit setting it to
  227. * false will avoid using packed encoding.
  228. *
  229. * Generated from protobuf field <code>optional bool packed = 2;</code>
  230. * @param bool $var
  231. * @return $this
  232. */
  233. public function setPacked($var)
  234. {
  235. GPBUtil::checkBool($var);
  236. $this->packed = $var;
  237. $this->has_packed = true;
  238. return $this;
  239. }
  240. public function hasPacked()
  241. {
  242. return $this->has_packed;
  243. }
  244. /**
  245. * The jstype option determines the JavaScript type used for values of the
  246. * field. The option is permitted only for 64 bit integral and fixed types
  247. * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
  248. * is represented as JavaScript string, which avoids loss of precision that
  249. * can happen when a large value is converted to a floating point JavaScript.
  250. * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
  251. * use the JavaScript "number" type. The behavior of the default option
  252. * JS_NORMAL is implementation dependent.
  253. * This option is an enum to permit additional types to be added, e.g.
  254. * goog.math.Integer.
  255. *
  256. * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];</code>
  257. * @return int
  258. */
  259. public function getJstype()
  260. {
  261. return $this->jstype;
  262. }
  263. /**
  264. * The jstype option determines the JavaScript type used for values of the
  265. * field. The option is permitted only for 64 bit integral and fixed types
  266. * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
  267. * is represented as JavaScript string, which avoids loss of precision that
  268. * can happen when a large value is converted to a floating point JavaScript.
  269. * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
  270. * use the JavaScript "number" type. The behavior of the default option
  271. * JS_NORMAL is implementation dependent.
  272. * This option is an enum to permit additional types to be added, e.g.
  273. * goog.math.Integer.
  274. *
  275. * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];</code>
  276. * @param int $var
  277. * @return $this
  278. */
  279. public function setJstype($var)
  280. {
  281. GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions\JSType::class);
  282. $this->jstype = $var;
  283. $this->has_jstype = true;
  284. return $this;
  285. }
  286. public function hasJstype()
  287. {
  288. return $this->has_jstype;
  289. }
  290. /**
  291. * Should this field be parsed lazily? Lazy applies only to message-type
  292. * fields. It means that when the outer message is initially parsed, the
  293. * inner message's contents will not be parsed but instead stored in encoded
  294. * form. The inner message will actually be parsed when it is first accessed.
  295. * This is only a hint. Implementations are free to choose whether to use
  296. * eager or lazy parsing regardless of the value of this option. However,
  297. * setting this option true suggests that the protocol author believes that
  298. * using lazy parsing on this field is worth the additional bookkeeping
  299. * overhead typically needed to implement it.
  300. * This option does not affect the public interface of any generated code;
  301. * all method signatures remain the same. Furthermore, thread-safety of the
  302. * interface is not affected by this option; const methods remain safe to
  303. * call from multiple threads concurrently, while non-const methods continue
  304. * to require exclusive access.
  305. * Note that implementations may choose not to check required fields within
  306. * a lazy sub-message. That is, calling IsInitialized() on the outer message
  307. * may return true even if the inner message has missing required fields.
  308. * This is necessary because otherwise the inner message would have to be
  309. * parsed in order to perform the check, defeating the purpose of lazy
  310. * parsing. An implementation which chooses not to check required fields
  311. * must be consistent about it. That is, for any particular sub-message, the
  312. * implementation must either *always* check its required fields, or *never*
  313. * check its required fields, regardless of whether or not the message has
  314. * been parsed.
  315. *
  316. * Generated from protobuf field <code>optional bool lazy = 5 [default = false];</code>
  317. * @return bool
  318. */
  319. public function getLazy()
  320. {
  321. return $this->lazy;
  322. }
  323. /**
  324. * Should this field be parsed lazily? Lazy applies only to message-type
  325. * fields. It means that when the outer message is initially parsed, the
  326. * inner message's contents will not be parsed but instead stored in encoded
  327. * form. The inner message will actually be parsed when it is first accessed.
  328. * This is only a hint. Implementations are free to choose whether to use
  329. * eager or lazy parsing regardless of the value of this option. However,
  330. * setting this option true suggests that the protocol author believes that
  331. * using lazy parsing on this field is worth the additional bookkeeping
  332. * overhead typically needed to implement it.
  333. * This option does not affect the public interface of any generated code;
  334. * all method signatures remain the same. Furthermore, thread-safety of the
  335. * interface is not affected by this option; const methods remain safe to
  336. * call from multiple threads concurrently, while non-const methods continue
  337. * to require exclusive access.
  338. * Note that implementations may choose not to check required fields within
  339. * a lazy sub-message. That is, calling IsInitialized() on the outer message
  340. * may return true even if the inner message has missing required fields.
  341. * This is necessary because otherwise the inner message would have to be
  342. * parsed in order to perform the check, defeating the purpose of lazy
  343. * parsing. An implementation which chooses not to check required fields
  344. * must be consistent about it. That is, for any particular sub-message, the
  345. * implementation must either *always* check its required fields, or *never*
  346. * check its required fields, regardless of whether or not the message has
  347. * been parsed.
  348. *
  349. * Generated from protobuf field <code>optional bool lazy = 5 [default = false];</code>
  350. * @param bool $var
  351. * @return $this
  352. */
  353. public function setLazy($var)
  354. {
  355. GPBUtil::checkBool($var);
  356. $this->lazy = $var;
  357. $this->has_lazy = true;
  358. return $this;
  359. }
  360. public function hasLazy()
  361. {
  362. return $this->has_lazy;
  363. }
  364. /**
  365. * Is this field deprecated?
  366. * Depending on the target platform, this can emit Deprecated annotations
  367. * for accessors, or it will be completely ignored; in the very least, this
  368. * is a formalization for deprecating fields.
  369. *
  370. * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
  371. * @return bool
  372. */
  373. public function getDeprecated()
  374. {
  375. return $this->deprecated;
  376. }
  377. /**
  378. * Is this field deprecated?
  379. * Depending on the target platform, this can emit Deprecated annotations
  380. * for accessors, or it will be completely ignored; in the very least, this
  381. * is a formalization for deprecating fields.
  382. *
  383. * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
  384. * @param bool $var
  385. * @return $this
  386. */
  387. public function setDeprecated($var)
  388. {
  389. GPBUtil::checkBool($var);
  390. $this->deprecated = $var;
  391. $this->has_deprecated = true;
  392. return $this;
  393. }
  394. public function hasDeprecated()
  395. {
  396. return $this->has_deprecated;
  397. }
  398. /**
  399. * For Google-internal migration only. Do not use.
  400. *
  401. * Generated from protobuf field <code>optional bool weak = 10 [default = false];</code>
  402. * @return bool
  403. */
  404. public function getWeak()
  405. {
  406. return $this->weak;
  407. }
  408. /**
  409. * For Google-internal migration only. Do not use.
  410. *
  411. * Generated from protobuf field <code>optional bool weak = 10 [default = false];</code>
  412. * @param bool $var
  413. * @return $this
  414. */
  415. public function setWeak($var)
  416. {
  417. GPBUtil::checkBool($var);
  418. $this->weak = $var;
  419. $this->has_weak = true;
  420. return $this;
  421. }
  422. public function hasWeak()
  423. {
  424. return $this->has_weak;
  425. }
  426. /**
  427. * The parser stores options it doesn't recognize here. See above.
  428. *
  429. * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
  430. * @return \Google\Protobuf\Internal\RepeatedField
  431. */
  432. public function getUninterpretedOption()
  433. {
  434. return $this->uninterpreted_option;
  435. }
  436. /**
  437. * The parser stores options it doesn't recognize here. See above.
  438. *
  439. * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
  440. * @param \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $var
  441. * @return $this
  442. */
  443. public function setUninterpretedOption($var)
  444. {
  445. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
  446. $this->uninterpreted_option = $arr;
  447. $this->has_uninterpreted_option = true;
  448. return $this;
  449. }
  450. public function hasUninterpretedOption()
  451. {
  452. return $this->has_uninterpreted_option;
  453. }
  454. }