FieldOptions.php 17 KB

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