FieldOptions.php 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  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. private $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. private $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. private $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. private $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. private $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. private $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. public function __construct() {
  107. \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
  108. parent::__construct();
  109. }
  110. /**
  111. * The ctype option instructs the C++ code generator to use a different
  112. * representation of the field than it normally would. See the specific
  113. * options below. This option is not yet implemented in the open source
  114. * release -- sorry, we'll try to include it in a future version!
  115. *
  116. * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];</code>
  117. * @return int
  118. */
  119. public function getCtype()
  120. {
  121. return $this->ctype;
  122. }
  123. /**
  124. * The ctype option instructs the C++ code generator to use a different
  125. * representation of the field than it normally would. See the specific
  126. * options below. This option is not yet implemented in the open source
  127. * release -- sorry, we'll try to include it in a future version!
  128. *
  129. * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];</code>
  130. * @param int $var
  131. * @return $this
  132. */
  133. public function setCtype($var)
  134. {
  135. GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions_CType::class);
  136. $this->ctype = $var;
  137. $this->has_ctype = true;
  138. return $this;
  139. }
  140. public function hasCtype()
  141. {
  142. return $this->has_ctype;
  143. }
  144. /**
  145. * The packed option can be enabled for repeated primitive fields to enable
  146. * a more efficient representation on the wire. Rather than repeatedly
  147. * writing the tag and type for each element, the entire array is encoded as
  148. * a single length-delimited blob. In proto3, only explicit setting it to
  149. * false will avoid using packed encoding.
  150. *
  151. * Generated from protobuf field <code>optional bool packed = 2;</code>
  152. * @return bool
  153. */
  154. public function getPacked()
  155. {
  156. return $this->packed;
  157. }
  158. /**
  159. * The packed option can be enabled for repeated primitive fields to enable
  160. * a more efficient representation on the wire. Rather than repeatedly
  161. * writing the tag and type for each element, the entire array is encoded as
  162. * a single length-delimited blob. In proto3, only explicit setting it to
  163. * false will avoid using packed encoding.
  164. *
  165. * Generated from protobuf field <code>optional bool packed = 2;</code>
  166. * @param bool $var
  167. * @return $this
  168. */
  169. public function setPacked($var)
  170. {
  171. GPBUtil::checkBool($var);
  172. $this->packed = $var;
  173. $this->has_packed = true;
  174. return $this;
  175. }
  176. public function hasPacked()
  177. {
  178. return $this->has_packed;
  179. }
  180. /**
  181. * The jstype option determines the JavaScript type used for values of the
  182. * field. The option is permitted only for 64 bit integral and fixed types
  183. * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
  184. * is represented as JavaScript string, which avoids loss of precision that
  185. * can happen when a large value is converted to a floating point JavaScript.
  186. * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
  187. * use the JavaScript "number" type. The behavior of the default option
  188. * JS_NORMAL is implementation dependent.
  189. * This option is an enum to permit additional types to be added, e.g.
  190. * goog.math.Integer.
  191. *
  192. * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];</code>
  193. * @return int
  194. */
  195. public function getJstype()
  196. {
  197. return $this->jstype;
  198. }
  199. /**
  200. * The jstype option determines the JavaScript type used for values of the
  201. * field. The option is permitted only for 64 bit integral and fixed types
  202. * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING
  203. * is represented as JavaScript string, which avoids loss of precision that
  204. * can happen when a large value is converted to a floating point JavaScript.
  205. * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
  206. * use the JavaScript "number" type. The behavior of the default option
  207. * JS_NORMAL is implementation dependent.
  208. * This option is an enum to permit additional types to be added, e.g.
  209. * goog.math.Integer.
  210. *
  211. * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];</code>
  212. * @param int $var
  213. * @return $this
  214. */
  215. public function setJstype($var)
  216. {
  217. GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions_JSType::class);
  218. $this->jstype = $var;
  219. $this->has_jstype = true;
  220. return $this;
  221. }
  222. public function hasJstype()
  223. {
  224. return $this->has_jstype;
  225. }
  226. /**
  227. * Should this field be parsed lazily? Lazy applies only to message-type
  228. * fields. It means that when the outer message is initially parsed, the
  229. * inner message's contents will not be parsed but instead stored in encoded
  230. * form. The inner message will actually be parsed when it is first accessed.
  231. * This is only a hint. Implementations are free to choose whether to use
  232. * eager or lazy parsing regardless of the value of this option. However,
  233. * setting this option true suggests that the protocol author believes that
  234. * using lazy parsing on this field is worth the additional bookkeeping
  235. * overhead typically needed to implement it.
  236. * This option does not affect the public interface of any generated code;
  237. * all method signatures remain the same. Furthermore, thread-safety of the
  238. * interface is not affected by this option; const methods remain safe to
  239. * call from multiple threads concurrently, while non-const methods continue
  240. * to require exclusive access.
  241. * Note that implementations may choose not to check required fields within
  242. * a lazy sub-message. That is, calling IsInitialized() on the outer message
  243. * may return true even if the inner message has missing required fields.
  244. * This is necessary because otherwise the inner message would have to be
  245. * parsed in order to perform the check, defeating the purpose of lazy
  246. * parsing. An implementation which chooses not to check required fields
  247. * must be consistent about it. That is, for any particular sub-message, the
  248. * implementation must either *always* check its required fields, or *never*
  249. * check its required fields, regardless of whether or not the message has
  250. * been parsed.
  251. *
  252. * Generated from protobuf field <code>optional bool lazy = 5 [default = false];</code>
  253. * @return bool
  254. */
  255. public function getLazy()
  256. {
  257. return $this->lazy;
  258. }
  259. /**
  260. * Should this field be parsed lazily? Lazy applies only to message-type
  261. * fields. It means that when the outer message is initially parsed, the
  262. * inner message's contents will not be parsed but instead stored in encoded
  263. * form. The inner message will actually be parsed when it is first accessed.
  264. * This is only a hint. Implementations are free to choose whether to use
  265. * eager or lazy parsing regardless of the value of this option. However,
  266. * setting this option true suggests that the protocol author believes that
  267. * using lazy parsing on this field is worth the additional bookkeeping
  268. * overhead typically needed to implement it.
  269. * This option does not affect the public interface of any generated code;
  270. * all method signatures remain the same. Furthermore, thread-safety of the
  271. * interface is not affected by this option; const methods remain safe to
  272. * call from multiple threads concurrently, while non-const methods continue
  273. * to require exclusive access.
  274. * Note that implementations may choose not to check required fields within
  275. * a lazy sub-message. That is, calling IsInitialized() on the outer message
  276. * may return true even if the inner message has missing required fields.
  277. * This is necessary because otherwise the inner message would have to be
  278. * parsed in order to perform the check, defeating the purpose of lazy
  279. * parsing. An implementation which chooses not to check required fields
  280. * must be consistent about it. That is, for any particular sub-message, the
  281. * implementation must either *always* check its required fields, or *never*
  282. * check its required fields, regardless of whether or not the message has
  283. * been parsed.
  284. *
  285. * Generated from protobuf field <code>optional bool lazy = 5 [default = false];</code>
  286. * @param bool $var
  287. * @return $this
  288. */
  289. public function setLazy($var)
  290. {
  291. GPBUtil::checkBool($var);
  292. $this->lazy = $var;
  293. $this->has_lazy = true;
  294. return $this;
  295. }
  296. public function hasLazy()
  297. {
  298. return $this->has_lazy;
  299. }
  300. /**
  301. * Is this field deprecated?
  302. * Depending on the target platform, this can emit Deprecated annotations
  303. * for accessors, or it will be completely ignored; in the very least, this
  304. * is a formalization for deprecating fields.
  305. *
  306. * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
  307. * @return bool
  308. */
  309. public function getDeprecated()
  310. {
  311. return $this->deprecated;
  312. }
  313. /**
  314. * Is this field deprecated?
  315. * Depending on the target platform, this can emit Deprecated annotations
  316. * for accessors, or it will be completely ignored; in the very least, this
  317. * is a formalization for deprecating fields.
  318. *
  319. * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
  320. * @param bool $var
  321. * @return $this
  322. */
  323. public function setDeprecated($var)
  324. {
  325. GPBUtil::checkBool($var);
  326. $this->deprecated = $var;
  327. $this->has_deprecated = true;
  328. return $this;
  329. }
  330. public function hasDeprecated()
  331. {
  332. return $this->has_deprecated;
  333. }
  334. /**
  335. * For Google-internal migration only. Do not use.
  336. *
  337. * Generated from protobuf field <code>optional bool weak = 10 [default = false];</code>
  338. * @return bool
  339. */
  340. public function getWeak()
  341. {
  342. return $this->weak;
  343. }
  344. /**
  345. * For Google-internal migration only. Do not use.
  346. *
  347. * Generated from protobuf field <code>optional bool weak = 10 [default = false];</code>
  348. * @param bool $var
  349. * @return $this
  350. */
  351. public function setWeak($var)
  352. {
  353. GPBUtil::checkBool($var);
  354. $this->weak = $var;
  355. $this->has_weak = true;
  356. return $this;
  357. }
  358. public function hasWeak()
  359. {
  360. return $this->has_weak;
  361. }
  362. /**
  363. * The parser stores options it doesn't recognize here. See above.
  364. *
  365. * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
  366. * @return \Google\Protobuf\Internal\RepeatedField
  367. */
  368. public function getUninterpretedOption()
  369. {
  370. return $this->uninterpreted_option;
  371. }
  372. /**
  373. * The parser stores options it doesn't recognize here. See above.
  374. *
  375. * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
  376. * @param \Google\Protobuf\Internal\UninterpretedOption[]|\Google\Protobuf\Internal\RepeatedField $var
  377. * @return $this
  378. */
  379. public function setUninterpretedOption($var)
  380. {
  381. $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
  382. $this->uninterpreted_option = $arr;
  383. $this->has_uninterpreted_option = true;
  384. return $this;
  385. }
  386. public function hasUninterpretedOption()
  387. {
  388. return $this->has_uninterpreted_option;
  389. }
  390. }