• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?php
2# Generated by the protocol buffer compiler.  DO NOT EDIT!
3# source: google/protobuf/descriptor.proto
4
5namespace Google\Protobuf\Internal;
6
7use Google\Protobuf\Internal\GPBType;
8use Google\Protobuf\Internal\GPBWire;
9use Google\Protobuf\Internal\RepeatedField;
10use Google\Protobuf\Internal\InputStream;
11use Google\Protobuf\Internal\GPBUtil;
12
13/**
14 * Generated from protobuf message <code>google.protobuf.FieldOptions</code>
15 */
16class FieldOptions extends \Google\Protobuf\Internal\Message
17{
18    /**
19     * The ctype option instructs the C++ code generator to use a different
20     * representation of the field than it normally would.  See the specific
21     * options below.  This option is not yet implemented in the open source
22     * release -- sorry, we'll try to include it in a future version!
23     *
24     * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];</code>
25     */
26    protected $ctype = null;
27    /**
28     * The packed option can be enabled for repeated primitive fields to enable
29     * a more efficient representation on the wire. Rather than repeatedly
30     * writing the tag and type for each element, the entire array is encoded as
31     * a single length-prefixed blob. In proto3, only explicit setting it to
32     * false will avoid using packed encoding.
33     *
34     * Generated from protobuf field <code>optional bool packed = 2;</code>
35     */
36    protected $packed = null;
37    /**
38     * The jstype option determines the JavaScript type used for values of the
39     * field.  The option is permitted only for 64 bit integral and fixed types
40     * (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING
41     * is represented as JavaScript string, which avoids loss of precision that
42     * can happen when a large value is converted to a floating point JavaScript.
43     * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
44     * use the JavaScript "number" type.  The behavior of the default option
45     * JS_NORMAL is implementation dependent.
46     * This option is an enum to permit additional types to be added, e.g.
47     * goog.math.Integer.
48     *
49     * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];</code>
50     */
51    protected $jstype = null;
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     * As of May 2022, lazy verifies the contents of the byte stream during
78     * parsing.  An invalid byte stream will cause the overall parsing to fail.
79     *
80     * Generated from protobuf field <code>optional bool lazy = 5 [default = false];</code>
81     */
82    protected $lazy = null;
83    /**
84     * unverified_lazy does no correctness checks on the byte stream. This should
85     * only be used where lazy with verification is prohibitive for performance
86     * reasons.
87     *
88     * Generated from protobuf field <code>optional bool unverified_lazy = 15 [default = false];</code>
89     */
90    protected $unverified_lazy = null;
91    /**
92     * Is this field deprecated?
93     * Depending on the target platform, this can emit Deprecated annotations
94     * for accessors, or it will be completely ignored; in the very least, this
95     * is a formalization for deprecating fields.
96     *
97     * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
98     */
99    protected $deprecated = null;
100    /**
101     * For Google-internal migration only. Do not use.
102     *
103     * Generated from protobuf field <code>optional bool weak = 10 [default = false];</code>
104     */
105    protected $weak = null;
106    /**
107     * The parser stores options it doesn't recognize here. See above.
108     *
109     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
110     */
111    private $uninterpreted_option;
112
113    /**
114     * Constructor.
115     *
116     * @param array $data {
117     *     Optional. Data for populating the Message object.
118     *
119     *     @type int $ctype
120     *           The ctype option instructs the C++ code generator to use a different
121     *           representation of the field than it normally would.  See the specific
122     *           options below.  This option is not yet implemented in the open source
123     *           release -- sorry, we'll try to include it in a future version!
124     *     @type bool $packed
125     *           The packed option can be enabled for repeated primitive fields to enable
126     *           a more efficient representation on the wire. Rather than repeatedly
127     *           writing the tag and type for each element, the entire array is encoded as
128     *           a single length-prefixed blob. In proto3, only explicit setting it to
129     *           false will avoid using packed encoding.
130     *     @type int $jstype
131     *           The jstype option determines the JavaScript type used for values of the
132     *           field.  The option is permitted only for 64 bit integral and fixed types
133     *           (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING
134     *           is represented as JavaScript string, which avoids loss of precision that
135     *           can happen when a large value is converted to a floating point JavaScript.
136     *           Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
137     *           use the JavaScript "number" type.  The behavior of the default option
138     *           JS_NORMAL is implementation dependent.
139     *           This option is an enum to permit additional types to be added, e.g.
140     *           goog.math.Integer.
141     *     @type bool $lazy
142     *           Should this field be parsed lazily?  Lazy applies only to message-type
143     *           fields.  It means that when the outer message is initially parsed, the
144     *           inner message's contents will not be parsed but instead stored in encoded
145     *           form.  The inner message will actually be parsed when it is first accessed.
146     *           This is only a hint.  Implementations are free to choose whether to use
147     *           eager or lazy parsing regardless of the value of this option.  However,
148     *           setting this option true suggests that the protocol author believes that
149     *           using lazy parsing on this field is worth the additional bookkeeping
150     *           overhead typically needed to implement it.
151     *           This option does not affect the public interface of any generated code;
152     *           all method signatures remain the same.  Furthermore, thread-safety of the
153     *           interface is not affected by this option; const methods remain safe to
154     *           call from multiple threads concurrently, while non-const methods continue
155     *           to require exclusive access.
156     *           Note that implementations may choose not to check required fields within
157     *           a lazy sub-message.  That is, calling IsInitialized() on the outer message
158     *           may return true even if the inner message has missing required fields.
159     *           This is necessary because otherwise the inner message would have to be
160     *           parsed in order to perform the check, defeating the purpose of lazy
161     *           parsing.  An implementation which chooses not to check required fields
162     *           must be consistent about it.  That is, for any particular sub-message, the
163     *           implementation must either *always* check its required fields, or *never*
164     *           check its required fields, regardless of whether or not the message has
165     *           been parsed.
166     *           As of May 2022, lazy verifies the contents of the byte stream during
167     *           parsing.  An invalid byte stream will cause the overall parsing to fail.
168     *     @type bool $unverified_lazy
169     *           unverified_lazy does no correctness checks on the byte stream. This should
170     *           only be used where lazy with verification is prohibitive for performance
171     *           reasons.
172     *     @type bool $deprecated
173     *           Is this field deprecated?
174     *           Depending on the target platform, this can emit Deprecated annotations
175     *           for accessors, or it will be completely ignored; in the very least, this
176     *           is a formalization for deprecating fields.
177     *     @type bool $weak
178     *           For Google-internal migration only. Do not use.
179     *     @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option
180     *           The parser stores options it doesn't recognize here. See above.
181     * }
182     */
183    public function __construct($data = NULL) {
184        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
185        parent::__construct($data);
186    }
187
188    /**
189     * The ctype option instructs the C++ code generator to use a different
190     * representation of the field than it normally would.  See the specific
191     * options below.  This option is not yet implemented in the open source
192     * release -- sorry, we'll try to include it in a future version!
193     *
194     * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];</code>
195     * @return int
196     */
197    public function getCtype()
198    {
199        return isset($this->ctype) ? $this->ctype : 0;
200    }
201
202    public function hasCtype()
203    {
204        return isset($this->ctype);
205    }
206
207    public function clearCtype()
208    {
209        unset($this->ctype);
210    }
211
212    /**
213     * The ctype option instructs the C++ code generator to use a different
214     * representation of the field than it normally would.  See the specific
215     * options below.  This option is not yet implemented in the open source
216     * release -- sorry, we'll try to include it in a future version!
217     *
218     * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.CType ctype = 1 [default = STRING];</code>
219     * @param int $var
220     * @return $this
221     */
222    public function setCtype($var)
223    {
224        GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions\CType::class);
225        $this->ctype = $var;
226
227        return $this;
228    }
229
230    /**
231     * The packed option can be enabled for repeated primitive fields to enable
232     * a more efficient representation on the wire. Rather than repeatedly
233     * writing the tag and type for each element, the entire array is encoded as
234     * a single length-prefixed blob. In proto3, only explicit setting it to
235     * false will avoid using packed encoding.
236     *
237     * Generated from protobuf field <code>optional bool packed = 2;</code>
238     * @return bool
239     */
240    public function getPacked()
241    {
242        return isset($this->packed) ? $this->packed : false;
243    }
244
245    public function hasPacked()
246    {
247        return isset($this->packed);
248    }
249
250    public function clearPacked()
251    {
252        unset($this->packed);
253    }
254
255    /**
256     * The packed option can be enabled for repeated primitive fields to enable
257     * a more efficient representation on the wire. Rather than repeatedly
258     * writing the tag and type for each element, the entire array is encoded as
259     * a single length-delimited blob. In proto3, only explicit setting it to
260     * false will avoid using packed encoding.
261     *
262     * Generated from protobuf field <code>optional bool packed = 2;</code>
263     * @param bool $var
264     * @return $this
265     */
266    public function setPacked($var)
267    {
268        GPBUtil::checkBool($var);
269        $this->packed = $var;
270
271        return $this;
272    }
273
274    /**
275     * The jstype option determines the JavaScript type used for values of the
276     * field.  The option is permitted only for 64 bit integral and fixed types
277     * (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING
278     * is represented as JavaScript string, which avoids loss of precision that
279     * can happen when a large value is converted to a floating point JavaScript.
280     * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
281     * use the JavaScript "number" type.  The behavior of the default option
282     * JS_NORMAL is implementation dependent.
283     * This option is an enum to permit additional types to be added, e.g.
284     * goog.math.Integer.
285     *
286     * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];</code>
287     * @return int
288     */
289    public function getJstype()
290    {
291        return isset($this->jstype) ? $this->jstype : 0;
292    }
293
294    public function hasJstype()
295    {
296        return isset($this->jstype);
297    }
298
299    public function clearJstype()
300    {
301        unset($this->jstype);
302    }
303
304    /**
305     * The jstype option determines the JavaScript type used for values of the
306     * field.  The option is permitted only for 64 bit integral and fixed types
307     * (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING
308     * is represented as JavaScript string, which avoids loss of precision that
309     * can happen when a large value is converted to a floating point JavaScript.
310     * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to
311     * use the JavaScript "number" type.  The behavior of the default option
312     * JS_NORMAL is implementation dependent.
313     * This option is an enum to permit additional types to be added, e.g.
314     * goog.math.Integer.
315     *
316     * Generated from protobuf field <code>optional .google.protobuf.FieldOptions.JSType jstype = 6 [default = JS_NORMAL];</code>
317     * @param int $var
318     * @return $this
319     */
320    public function setJstype($var)
321    {
322        GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FieldOptions\JSType::class);
323        $this->jstype = $var;
324
325        return $this;
326    }
327
328    /**
329     * Should this field be parsed lazily?  Lazy applies only to message-type
330     * fields.  It means that when the outer message is initially parsed, the
331     * inner message's contents will not be parsed but instead stored in encoded
332     * form.  The inner message will actually be parsed when it is first accessed.
333     * This is only a hint.  Implementations are free to choose whether to use
334     * eager or lazy parsing regardless of the value of this option.  However,
335     * setting this option true suggests that the protocol author believes that
336     * using lazy parsing on this field is worth the additional bookkeeping
337     * overhead typically needed to implement it.
338     * This option does not affect the public interface of any generated code;
339     * all method signatures remain the same.  Furthermore, thread-safety of the
340     * interface is not affected by this option; const methods remain safe to
341     * call from multiple threads concurrently, while non-const methods continue
342     * to require exclusive access.
343     * Note that implementations may choose not to check required fields within
344     * a lazy sub-message.  That is, calling IsInitialized() on the outer message
345     * may return true even if the inner message has missing required fields.
346     * This is necessary because otherwise the inner message would have to be
347     * parsed in order to perform the check, defeating the purpose of lazy
348     * parsing.  An implementation which chooses not to check required fields
349     * must be consistent about it.  That is, for any particular sub-message, the
350     * implementation must either *always* check its required fields, or *never*
351     * check its required fields, regardless of whether or not the message has
352     * been parsed.
353     * As of May 2022, lazy verifies the contents of the byte stream during
354     * parsing.  An invalid byte stream will cause the overall parsing to fail.
355     *
356     * Generated from protobuf field <code>optional bool lazy = 5 [default = false];</code>
357     * @return bool
358     */
359    public function getLazy()
360    {
361        return isset($this->lazy) ? $this->lazy : false;
362    }
363
364    public function hasLazy()
365    {
366        return isset($this->lazy);
367    }
368
369    public function clearLazy()
370    {
371        unset($this->lazy);
372    }
373
374    /**
375     * Should this field be parsed lazily?  Lazy applies only to message-type
376     * fields.  It means that when the outer message is initially parsed, the
377     * inner message's contents will not be parsed but instead stored in encoded
378     * form.  The inner message will actually be parsed when it is first accessed.
379     * This is only a hint.  Implementations are free to choose whether to use
380     * eager or lazy parsing regardless of the value of this option.  However,
381     * setting this option true suggests that the protocol author believes that
382     * using lazy parsing on this field is worth the additional bookkeeping
383     * overhead typically needed to implement it.
384     * This option does not affect the public interface of any generated code;
385     * all method signatures remain the same.  Furthermore, thread-safety of the
386     * interface is not affected by this option; const methods remain safe to
387     * call from multiple threads concurrently, while non-const methods continue
388     * to require exclusive access.
389     * Note that implementations may choose not to check required fields within
390     * a lazy sub-message.  That is, calling IsInitialized() on the outer message
391     * may return true even if the inner message has missing required fields.
392     * This is necessary because otherwise the inner message would have to be
393     * parsed in order to perform the check, defeating the purpose of lazy
394     * parsing.  An implementation which chooses not to check required fields
395     * must be consistent about it.  That is, for any particular sub-message, the
396     * implementation must either *always* check its required fields, or *never*
397     * check its required fields, regardless of whether or not the message has
398     * been parsed.
399     * As of May 2022, lazy verifies the contents of the byte stream during
400     * parsing.  An invalid byte stream will cause the overall parsing to fail.
401     *
402     * Generated from protobuf field <code>optional bool lazy = 5 [default = false];</code>
403     * @param bool $var
404     * @return $this
405     */
406    public function setLazy($var)
407    {
408        GPBUtil::checkBool($var);
409        $this->lazy = $var;
410
411        return $this;
412    }
413
414    /**
415     * unverified_lazy does no correctness checks on the byte stream. This should
416     * only be used where lazy with verification is prohibitive for performance
417     * reasons.
418     *
419     * Generated from protobuf field <code>optional bool unverified_lazy = 15 [default = false];</code>
420     * @return bool
421     */
422    public function getUnverifiedLazy()
423    {
424        return isset($this->unverified_lazy) ? $this->unverified_lazy : false;
425    }
426
427    public function hasUnverifiedLazy()
428    {
429        return isset($this->unverified_lazy);
430    }
431
432    public function clearUnverifiedLazy()
433    {
434        unset($this->unverified_lazy);
435    }
436
437    /**
438     * unverified_lazy does no correctness checks on the byte stream. This should
439     * only be used where lazy with verification is prohibitive for performance
440     * reasons.
441     *
442     * Generated from protobuf field <code>optional bool unverified_lazy = 15 [default = false];</code>
443     * @param bool $var
444     * @return $this
445     */
446    public function setUnverifiedLazy($var)
447    {
448        GPBUtil::checkBool($var);
449        $this->unverified_lazy = $var;
450
451        return $this;
452    }
453
454    /**
455     * Is this field deprecated?
456     * Depending on the target platform, this can emit Deprecated annotations
457     * for accessors, or it will be completely ignored; in the very least, this
458     * is a formalization for deprecating fields.
459     *
460     * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
461     * @return bool
462     */
463    public function getDeprecated()
464    {
465        return isset($this->deprecated) ? $this->deprecated : false;
466    }
467
468    public function hasDeprecated()
469    {
470        return isset($this->deprecated);
471    }
472
473    public function clearDeprecated()
474    {
475        unset($this->deprecated);
476    }
477
478    /**
479     * Is this field deprecated?
480     * Depending on the target platform, this can emit Deprecated annotations
481     * for accessors, or it will be completely ignored; in the very least, this
482     * is a formalization for deprecating fields.
483     *
484     * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
485     * @param bool $var
486     * @return $this
487     */
488    public function setDeprecated($var)
489    {
490        GPBUtil::checkBool($var);
491        $this->deprecated = $var;
492
493        return $this;
494    }
495
496    /**
497     * For Google-internal migration only. Do not use.
498     *
499     * Generated from protobuf field <code>optional bool weak = 10 [default = false];</code>
500     * @return bool
501     */
502    public function getWeak()
503    {
504        return isset($this->weak) ? $this->weak : false;
505    }
506
507    public function hasWeak()
508    {
509        return isset($this->weak);
510    }
511
512    public function clearWeak()
513    {
514        unset($this->weak);
515    }
516
517    /**
518     * For Google-internal migration only. Do not use.
519     *
520     * Generated from protobuf field <code>optional bool weak = 10 [default = false];</code>
521     * @param bool $var
522     * @return $this
523     */
524    public function setWeak($var)
525    {
526        GPBUtil::checkBool($var);
527        $this->weak = $var;
528
529        return $this;
530    }
531
532    /**
533     * The parser stores options it doesn't recognize here. See above.
534     *
535     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
536     * @return \Google\Protobuf\Internal\RepeatedField
537     */
538    public function getUninterpretedOption()
539    {
540        return $this->uninterpreted_option;
541    }
542
543    /**
544     * The parser stores options it doesn't recognize here. See above.
545     *
546     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
547     * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var
548     * @return $this
549     */
550    public function setUninterpretedOption($var)
551    {
552        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
553        $this->uninterpreted_option = $arr;
554
555        return $this;
556    }
557
558}
559
560