Debian Codegraph @

examples/node/static_codegen/route_guide/route_guide_pb.js

raw
1 // source: route_guide.proto
2 /**
3 * @fileoverview
4 * @enhanceable
5 * @suppress {messageConventions} JS Compiler reports an error if a variable or
6 * field starts with 'MSG_' and isn't a translatable message.
7 * @public
8 */
9 // GENERATED CODE -- DO NOT EDIT!
10
11 var jspb = require('google-protobuf');
12 var goog = jspb;
13 var global = Function('return this')();
14
15 goog.exportSymbol('proto.routeguide.Feature', null, global);
16 goog.exportSymbol('proto.routeguide.Point', null, global);
17 goog.exportSymbol('proto.routeguide.Rectangle', null, global);
18 goog.exportSymbol('proto.routeguide.RouteNote', null, global);
19 goog.exportSymbol('proto.routeguide.RouteSummary', null, global);
20 /**
21 * Generated by JsPbCodeGenerator.
22 * @param {Array=} opt_data Optional initial data array, typically from a
23 * server response, or constructed directly in Javascript. The array is used
24 * in place and becomes part of the constructed object. It is not cloned.
25 * If no data is provided, the constructed object will be empty, but still
26 * valid.
27 * @extends {jspb.Message}
28 * @constructor
29 */
30 proto.routeguide.Point = function(opt_data) {
31 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
32 };
33 goog.inherits(proto.routeguide.Point, jspb.Message);
34 if (goog.DEBUG && !COMPILED) {
35 /**
36 * @public
37 * @override
38 */
39 proto.routeguide.Point.displayName = 'proto.routeguide.Point';
40 }
41 /**
42 * Generated by JsPbCodeGenerator.
43 * @param {Array=} opt_data Optional initial data array, typically from a
44 * server response, or constructed directly in Javascript. The array is used
45 * in place and becomes part of the constructed object. It is not cloned.
46 * If no data is provided, the constructed object will be empty, but still
47 * valid.
48 * @extends {jspb.Message}
49 * @constructor
50 */
51 proto.routeguide.Rectangle = function(opt_data) {
52 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
53 };
54 goog.inherits(proto.routeguide.Rectangle, jspb.Message);
55 if (goog.DEBUG && !COMPILED) {
56 /**
57 * @public
58 * @override
59 */
60 proto.routeguide.Rectangle.displayName = 'proto.routeguide.Rectangle';
61 }
62 /**
63 * Generated by JsPbCodeGenerator.
64 * @param {Array=} opt_data Optional initial data array, typically from a
65 * server response, or constructed directly in Javascript. The array is used
66 * in place and becomes part of the constructed object. It is not cloned.
67 * If no data is provided, the constructed object will be empty, but still
68 * valid.
69 * @extends {jspb.Message}
70 * @constructor
71 */
72 proto.routeguide.Feature = function(opt_data) {
73 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
74 };
75 goog.inherits(proto.routeguide.Feature, jspb.Message);
76 if (goog.DEBUG && !COMPILED) {
77 /**
78 * @public
79 * @override
80 */
81 proto.routeguide.Feature.displayName = 'proto.routeguide.Feature';
82 }
83 /**
84 * Generated by JsPbCodeGenerator.
85 * @param {Array=} opt_data Optional initial data array, typically from a
86 * server response, or constructed directly in Javascript. The array is used
87 * in place and becomes part of the constructed object. It is not cloned.
88 * If no data is provided, the constructed object will be empty, but still
89 * valid.
90 * @extends {jspb.Message}
91 * @constructor
92 */
93 proto.routeguide.RouteNote = function(opt_data) {
94 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
95 };
96 goog.inherits(proto.routeguide.RouteNote, jspb.Message);
97 if (goog.DEBUG && !COMPILED) {
98 /**
99 * @public
100 * @override
101 */
102 proto.routeguide.RouteNote.displayName = 'proto.routeguide.RouteNote';
103 }
104 /**
105 * Generated by JsPbCodeGenerator.
106 * @param {Array=} opt_data Optional initial data array, typically from a
107 * server response, or constructed directly in Javascript. The array is used
108 * in place and becomes part of the constructed object. It is not cloned.
109 * If no data is provided, the constructed object will be empty, but still
110 * valid.
111 * @extends {jspb.Message}
112 * @constructor
113 */
114 proto.routeguide.RouteSummary = function(opt_data) {
115 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
116 };
117 goog.inherits(proto.routeguide.RouteSummary, jspb.Message);
118 if (goog.DEBUG && !COMPILED) {
119 /**
120 * @public
121 * @override
122 */
123 proto.routeguide.RouteSummary.displayName = 'proto.routeguide.RouteSummary';
124 }
125
126
127
128 if (jspb.Message.GENERATE_TO_OBJECT) {
129 /**
130 * Creates an object representation of this proto.
131 * Field names that are reserved in JavaScript and will be renamed to pb_name.
132 * Optional fields that are not set will be set to undefined.
133 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
134 * For the list of reserved names please see:
135 * net/proto2/compiler/js/internal/generator.cc#kKeyword.
136 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
137 * JSPB instance for transitional soy proto support:
138 * http://goto/soy-param-migration
139 * @return {!Object}
140 */
141 proto.routeguide.Point.prototype.toObject = function(opt_includeInstance) {
142 return proto.routeguide.Point.toObject(opt_includeInstance, this);
143 };
144
145
146 /**
147 * Static version of the {@see toObject} method.
148 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
149 * the JSPB instance for transitional soy proto support:
150 * http://goto/soy-param-migration
151 * @param {!proto.routeguide.Point} msg The msg instance to transform.
152 * @return {!Object}
153 * @suppress {unusedLocalVariables} f is only used for nested messages
154 */
155 proto.routeguide.Point.toObject = function(includeInstance, msg) {
156 var f, obj = {
157 latitude: jspb.Message.getFieldWithDefault(msg, 1, 0),
158 longitude: jspb.Message.getFieldWithDefault(msg, 2, 0)
159 };
160
161 if (includeInstance) {
162 obj.$jspbMessageInstance = msg;
163 }
164 return obj;
165 };
166 }
167
168
169 /**
170 * Deserializes binary data (in protobuf wire format).
171 * @param {jspb.ByteSource} bytes The bytes to deserialize.
172 * @return {!proto.routeguide.Point}
173 */
174 proto.routeguide.Point.deserializeBinary = function(bytes) {
175 var reader = new jspb.BinaryReader(bytes);
176 var msg = new proto.routeguide.Point;
177 return proto.routeguide.Point.deserializeBinaryFromReader(msg, reader);
178 };
179
180
181 /**
182 * Deserializes binary data (in protobuf wire format) from the
183 * given reader into the given message object.
184 * @param {!proto.routeguide.Point} msg The message object to deserialize into.
185 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
186 * @return {!proto.routeguide.Point}
187 */
188 proto.routeguide.Point.deserializeBinaryFromReader = function(msg, reader) {
189 while (reader.nextField()) {
190 if (reader.isEndGroup()) {
191 break;
192 }
193 var field = reader.getFieldNumber();
194 switch (field) {
195 case 1:
196 var value = /** @type {number} */ (reader.readInt32());
197 msg.setLatitude(value);
198 break;
199 case 2:
200 var value = /** @type {number} */ (reader.readInt32());
201 msg.setLongitude(value);
202 break;
203 default:
204 reader.skipField();
205 break;
206 }
207 }
208 return msg;
209 };
210
211
212 /**
213 * Serializes the message to binary data (in protobuf wire format).
214 * @return {!Uint8Array}
215 */
216 proto.routeguide.Point.prototype.serializeBinary = function() {
217 var writer = new jspb.BinaryWriter();
218 proto.routeguide.Point.serializeBinaryToWriter(this, writer);
219 return writer.getResultBuffer();
220 };
221
222
223 /**
224 * Serializes the given message to binary data (in protobuf wire
225 * format), writing to the given BinaryWriter.
226 * @param {!proto.routeguide.Point} message
227 * @param {!jspb.BinaryWriter} writer
228 * @suppress {unusedLocalVariables} f is only used for nested messages
229 */
230 proto.routeguide.Point.serializeBinaryToWriter = function(message, writer) {
231 var f = undefined;
232 f = message.getLatitude();
233 if (f !== 0) {
234 writer.writeInt32(
235 1,
236 f
237 );
238 }
239 f = message.getLongitude();
240 if (f !== 0) {
241 writer.writeInt32(
242 2,
243 f
244 );
245 }
246 };
247
248
249 /**
250 * optional int32 latitude = 1;
251 * @return {number}
252 */
253 proto.routeguide.Point.prototype.getLatitude = function() {
254 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
255 };
256
257
258 /**
259 * @param {number} value
260 * @return {!proto.routeguide.Point} returns this
261 */
262 proto.routeguide.Point.prototype.setLatitude = function(value) {
263 return jspb.Message.setProto3IntField(this, 1, value);
264 };
265
266
267 /**
268 * optional int32 longitude = 2;
269 * @return {number}
270 */
271 proto.routeguide.Point.prototype.getLongitude = function() {
272 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
273 };
274
275
276 /**
277 * @param {number} value
278 * @return {!proto.routeguide.Point} returns this
279 */
280 proto.routeguide.Point.prototype.setLongitude = function(value) {
281 return jspb.Message.setProto3IntField(this, 2, value);
282 };
283
284
285
286
287
288 if (jspb.Message.GENERATE_TO_OBJECT) {
289 /**
290 * Creates an object representation of this proto.
291 * Field names that are reserved in JavaScript and will be renamed to pb_name.
292 * Optional fields that are not set will be set to undefined.
293 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
294 * For the list of reserved names please see:
295 * net/proto2/compiler/js/internal/generator.cc#kKeyword.
296 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
297 * JSPB instance for transitional soy proto support:
298 * http://goto/soy-param-migration
299 * @return {!Object}
300 */
301 proto.routeguide.Rectangle.prototype.toObject = function(opt_includeInstance) {
302 return proto.routeguide.Rectangle.toObject(opt_includeInstance, this);
303 };
304
305
306 /**
307 * Static version of the {@see toObject} method.
308 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
309 * the JSPB instance for transitional soy proto support:
310 * http://goto/soy-param-migration
311 * @param {!proto.routeguide.Rectangle} msg The msg instance to transform.
312 * @return {!Object}
313 * @suppress {unusedLocalVariables} f is only used for nested messages
314 */
315 proto.routeguide.Rectangle.toObject = function(includeInstance, msg) {
316 var f, obj = {
317 lo: (f = msg.getLo()) && proto.routeguide.Point.toObject(includeInstance, f),
318 hi: (f = msg.getHi()) && proto.routeguide.Point.toObject(includeInstance, f)
319 };
320
321 if (includeInstance) {
322 obj.$jspbMessageInstance = msg;
323 }
324 return obj;
325 };
326 }
327
328
329 /**
330 * Deserializes binary data (in protobuf wire format).
331 * @param {jspb.ByteSource} bytes The bytes to deserialize.
332 * @return {!proto.routeguide.Rectangle}
333 */
334 proto.routeguide.Rectangle.deserializeBinary = function(bytes) {
335 var reader = new jspb.BinaryReader(bytes);
336 var msg = new proto.routeguide.Rectangle;
337 return proto.routeguide.Rectangle.deserializeBinaryFromReader(msg, reader);
338 };
339
340
341 /**
342 * Deserializes binary data (in protobuf wire format) from the
343 * given reader into the given message object.
344 * @param {!proto.routeguide.Rectangle} msg The message object to deserialize into.
345 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
346 * @return {!proto.routeguide.Rectangle}
347 */
348 proto.routeguide.Rectangle.deserializeBinaryFromReader = function(msg, reader) {
349 while (reader.nextField()) {
350 if (reader.isEndGroup()) {
351 break;
352 }
353 var field = reader.getFieldNumber();
354 switch (field) {
355 case 1:
356 var value = new proto.routeguide.Point;
357 reader.readMessage(value,proto.routeguide.Point.deserializeBinaryFromReader);
358 msg.setLo(value);
359 break;
360 case 2:
361 var value = new proto.routeguide.Point;
362 reader.readMessage(value,proto.routeguide.Point.deserializeBinaryFromReader);
363 msg.setHi(value);
364 break;
365 default:
366 reader.skipField();
367 break;
368 }
369 }
370 return msg;
371 };
372
373
374 /**
375 * Serializes the message to binary data (in protobuf wire format).
376 * @return {!Uint8Array}
377 */
378 proto.routeguide.Rectangle.prototype.serializeBinary = function() {
379 var writer = new jspb.BinaryWriter();
380 proto.routeguide.Rectangle.serializeBinaryToWriter(this, writer);
381 return writer.getResultBuffer();
382 };
383
384
385 /**
386 * Serializes the given message to binary data (in protobuf wire
387 * format), writing to the given BinaryWriter.
388 * @param {!proto.routeguide.Rectangle} message
389 * @param {!jspb.BinaryWriter} writer
390 * @suppress {unusedLocalVariables} f is only used for nested messages
391 */
392 proto.routeguide.Rectangle.serializeBinaryToWriter = function(message, writer) {
393 var f = undefined;
394 f = message.getLo();
395 if (f != null) {
396 writer.writeMessage(
397 1,
398 f,
399 proto.routeguide.Point.serializeBinaryToWriter
400 );
401 }
402 f = message.getHi();
403 if (f != null) {
404 writer.writeMessage(
405 2,
406 f,
407 proto.routeguide.Point.serializeBinaryToWriter
408 );
409 }
410 };
411
412
413 /**
414 * optional Point lo = 1;
415 * @return {?proto.routeguide.Point}
416 */
417 proto.routeguide.Rectangle.prototype.getLo = function() {
418 return /** @type{?proto.routeguide.Point} */ (
419 jspb.Message.getWrapperField(this, proto.routeguide.Point, 1));
420 };
421
422
423 /**
424 * @param {?proto.routeguide.Point|undefined} value
425 * @return {!proto.routeguide.Rectangle} returns this
426 */
427 proto.routeguide.Rectangle.prototype.setLo = function(value) {
428 return jspb.Message.setWrapperField(this, 1, value);
429 };
430
431
432 /**
433 * Clears the message field making it undefined.
434 * @return {!proto.routeguide.Rectangle} returns this
435 */
436 proto.routeguide.Rectangle.prototype.clearLo = function() {
437 return this.setLo(undefined);
438 };
439
440
441 /**
442 * Returns whether this field is set.
443 * @return {boolean}
444 */
445 proto.routeguide.Rectangle.prototype.hasLo = function() {
446 return jspb.Message.getField(this, 1) != null;
447 };
448
449
450 /**
451 * optional Point hi = 2;
452 * @return {?proto.routeguide.Point}
453 */
454 proto.routeguide.Rectangle.prototype.getHi = function() {
455 return /** @type{?proto.routeguide.Point} */ (
456 jspb.Message.getWrapperField(this, proto.routeguide.Point, 2));
457 };
458
459
460 /**
461 * @param {?proto.routeguide.Point|undefined} value
462 * @return {!proto.routeguide.Rectangle} returns this
463 */
464 proto.routeguide.Rectangle.prototype.setHi = function(value) {
465 return jspb.Message.setWrapperField(this, 2, value);
466 };
467
468
469 /**
470 * Clears the message field making it undefined.
471 * @return {!proto.routeguide.Rectangle} returns this
472 */
473 proto.routeguide.Rectangle.prototype.clearHi = function() {
474 return this.setHi(undefined);
475 };
476
477
478 /**
479 * Returns whether this field is set.
480 * @return {boolean}
481 */
482 proto.routeguide.Rectangle.prototype.hasHi = function() {
483 return jspb.Message.getField(this, 2) != null;
484 };
485
486
487
488
489
490 if (jspb.Message.GENERATE_TO_OBJECT) {
491 /**
492 * Creates an object representation of this proto.
493 * Field names that are reserved in JavaScript and will be renamed to pb_name.
494 * Optional fields that are not set will be set to undefined.
495 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
496 * For the list of reserved names please see:
497 * net/proto2/compiler/js/internal/generator.cc#kKeyword.
498 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
499 * JSPB instance for transitional soy proto support:
500 * http://goto/soy-param-migration
501 * @return {!Object}
502 */
503 proto.routeguide.Feature.prototype.toObject = function(opt_includeInstance) {
504 return proto.routeguide.Feature.toObject(opt_includeInstance, this);
505 };
506
507
508 /**
509 * Static version of the {@see toObject} method.
510 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
511 * the JSPB instance for transitional soy proto support:
512 * http://goto/soy-param-migration
513 * @param {!proto.routeguide.Feature} msg The msg instance to transform.
514 * @return {!Object}
515 * @suppress {unusedLocalVariables} f is only used for nested messages
516 */
517 proto.routeguide.Feature.toObject = function(includeInstance, msg) {
518 var f, obj = {
519 name: jspb.Message.getFieldWithDefault(msg, 1, ""),
520 location: (f = msg.getLocation()) && proto.routeguide.Point.toObject(includeInstance, f)
521 };
522
523 if (includeInstance) {
524 obj.$jspbMessageInstance = msg;
525 }
526 return obj;
527 };
528 }
529
530
531 /**
532 * Deserializes binary data (in protobuf wire format).
533 * @param {jspb.ByteSource} bytes The bytes to deserialize.
534 * @return {!proto.routeguide.Feature}
535 */
536 proto.routeguide.Feature.deserializeBinary = function(bytes) {
537 var reader = new jspb.BinaryReader(bytes);
538 var msg = new proto.routeguide.Feature;
539 return proto.routeguide.Feature.deserializeBinaryFromReader(msg, reader);
540 };
541
542
543 /**
544 * Deserializes binary data (in protobuf wire format) from the
545 * given reader into the given message object.
546 * @param {!proto.routeguide.Feature} msg The message object to deserialize into.
547 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
548 * @return {!proto.routeguide.Feature}
549 */
550 proto.routeguide.Feature.deserializeBinaryFromReader = function(msg, reader) {
551 while (reader.nextField()) {
552 if (reader.isEndGroup()) {
553 break;
554 }
555 var field = reader.getFieldNumber();
556 switch (field) {
557 case 1:
558 var value = /** @type {string} */ (reader.readString());
559 msg.setName(value);
560 break;
561 case 2:
562 var value = new proto.routeguide.Point;
563 reader.readMessage(value,proto.routeguide.Point.deserializeBinaryFromReader);
564 msg.setLocation(value);
565 break;
566 default:
567 reader.skipField();
568 break;
569 }
570 }
571 return msg;
572 };
573
574
575 /**
576 * Serializes the message to binary data (in protobuf wire format).
577 * @return {!Uint8Array}
578 */
579 proto.routeguide.Feature.prototype.serializeBinary = function() {
580 var writer = new jspb.BinaryWriter();
581 proto.routeguide.Feature.serializeBinaryToWriter(this, writer);
582 return writer.getResultBuffer();
583 };
584
585
586 /**
587 * Serializes the given message to binary data (in protobuf wire
588 * format), writing to the given BinaryWriter.
589 * @param {!proto.routeguide.Feature} message
590 * @param {!jspb.BinaryWriter} writer
591 * @suppress {unusedLocalVariables} f is only used for nested messages
592 */
593 proto.routeguide.Feature.serializeBinaryToWriter = function(message, writer) {
594 var f = undefined;
595 f = message.getName();
596 if (f.length > 0) {
597 writer.writeString(
598 1,
599 f
600 );
601 }
602 f = message.getLocation();
603 if (f != null) {
604 writer.writeMessage(
605 2,
606 f,
607 proto.routeguide.Point.serializeBinaryToWriter
608 );
609 }
610 };
611
612
613 /**
614 * optional string name = 1;
615 * @return {string}
616 */
617 proto.routeguide.Feature.prototype.getName = function() {
618 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
619 };
620
621
622 /**
623 * @param {string} value
624 * @return {!proto.routeguide.Feature} returns this
625 */
626 proto.routeguide.Feature.prototype.setName = function(value) {
627 return jspb.Message.setProto3StringField(this, 1, value);
628 };
629
630
631 /**
632 * optional Point location = 2;
633 * @return {?proto.routeguide.Point}
634 */
635 proto.routeguide.Feature.prototype.getLocation = function() {
636 return /** @type{?proto.routeguide.Point} */ (
637 jspb.Message.getWrapperField(this, proto.routeguide.Point, 2));
638 };
639
640
641 /**
642 * @param {?proto.routeguide.Point|undefined} value
643 * @return {!proto.routeguide.Feature} returns this
644 */
645 proto.routeguide.Feature.prototype.setLocation = function(value) {
646 return jspb.Message.setWrapperField(this, 2, value);
647 };
648
649
650 /**
651 * Clears the message field making it undefined.
652 * @return {!proto.routeguide.Feature} returns this
653 */
654 proto.routeguide.Feature.prototype.clearLocation = function() {
655 return this.setLocation(undefined);
656 };
657
658
659 /**
660 * Returns whether this field is set.
661 * @return {boolean}
662 */
663 proto.routeguide.Feature.prototype.hasLocation = function() {
664 return jspb.Message.getField(this, 2) != null;
665 };
666
667
668
669
670
671 if (jspb.Message.GENERATE_TO_OBJECT) {
672 /**
673 * Creates an object representation of this proto.
674 * Field names that are reserved in JavaScript and will be renamed to pb_name.
675 * Optional fields that are not set will be set to undefined.
676 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
677 * For the list of reserved names please see:
678 * net/proto2/compiler/js/internal/generator.cc#kKeyword.
679 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
680 * JSPB instance for transitional soy proto support:
681 * http://goto/soy-param-migration
682 * @return {!Object}
683 */
684 proto.routeguide.RouteNote.prototype.toObject = function(opt_includeInstance) {
685 return proto.routeguide.RouteNote.toObject(opt_includeInstance, this);
686 };
687
688
689 /**
690 * Static version of the {@see toObject} method.
691 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
692 * the JSPB instance for transitional soy proto support:
693 * http://goto/soy-param-migration
694 * @param {!proto.routeguide.RouteNote} msg The msg instance to transform.
695 * @return {!Object}
696 * @suppress {unusedLocalVariables} f is only used for nested messages
697 */
698 proto.routeguide.RouteNote.toObject = function(includeInstance, msg) {
699 var f, obj = {
700 location: (f = msg.getLocation()) && proto.routeguide.Point.toObject(includeInstance, f),
701 message: jspb.Message.getFieldWithDefault(msg, 2, "")
702 };
703
704 if (includeInstance) {
705 obj.$jspbMessageInstance = msg;
706 }
707 return obj;
708 };
709 }
710
711
712 /**
713 * Deserializes binary data (in protobuf wire format).
714 * @param {jspb.ByteSource} bytes The bytes to deserialize.
715 * @return {!proto.routeguide.RouteNote}
716 */
717 proto.routeguide.RouteNote.deserializeBinary = function(bytes) {
718 var reader = new jspb.BinaryReader(bytes);
719 var msg = new proto.routeguide.RouteNote;
720 return proto.routeguide.RouteNote.deserializeBinaryFromReader(msg, reader);
721 };
722
723
724 /**
725 * Deserializes binary data (in protobuf wire format) from the
726 * given reader into the given message object.
727 * @param {!proto.routeguide.RouteNote} msg The message object to deserialize into.
728 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
729 * @return {!proto.routeguide.RouteNote}
730 */
731 proto.routeguide.RouteNote.deserializeBinaryFromReader = function(msg, reader) {
732 while (reader.nextField()) {
733 if (reader.isEndGroup()) {
734 break;
735 }
736 var field = reader.getFieldNumber();
737 switch (field) {
738 case 1:
739 var value = new proto.routeguide.Point;
740 reader.readMessage(value,proto.routeguide.Point.deserializeBinaryFromReader);
741 msg.setLocation(value);
742 break;
743 case 2:
744 var value = /** @type {string} */ (reader.readString());
745 msg.setMessage(value);
746 break;
747 default:
748 reader.skipField();
749 break;
750 }
751 }
752 return msg;
753 };
754
755
756 /**
757 * Serializes the message to binary data (in protobuf wire format).
758 * @return {!Uint8Array}
759 */
760 proto.routeguide.RouteNote.prototype.serializeBinary = function() {
761 var writer = new jspb.BinaryWriter();
762 proto.routeguide.RouteNote.serializeBinaryToWriter(this, writer);
763 return writer.getResultBuffer();
764 };
765
766
767 /**
768 * Serializes the given message to binary data (in protobuf wire
769 * format), writing to the given BinaryWriter.
770 * @param {!proto.routeguide.RouteNote} message
771 * @param {!jspb.BinaryWriter} writer
772 * @suppress {unusedLocalVariables} f is only used for nested messages
773 */
774 proto.routeguide.RouteNote.serializeBinaryToWriter = function(message, writer) {
775 var f = undefined;
776 f = message.getLocation();
777 if (f != null) {
778 writer.writeMessage(
779 1,
780 f,
781 proto.routeguide.Point.serializeBinaryToWriter
782 );
783 }
784 f = message.getMessage();
785 if (f.length > 0) {
786 writer.writeString(
787 2,
788 f
789 );
790 }
791 };
792
793
794 /**
795 * optional Point location = 1;
796 * @return {?proto.routeguide.Point}
797 */
798 proto.routeguide.RouteNote.prototype.getLocation = function() {
799 return /** @type{?proto.routeguide.Point} */ (
800 jspb.Message.getWrapperField(this, proto.routeguide.Point, 1));
801 };
802
803
804 /**
805 * @param {?proto.routeguide.Point|undefined} value
806 * @return {!proto.routeguide.RouteNote} returns this
807 */
808 proto.routeguide.RouteNote.prototype.setLocation = function(value) {
809 return jspb.Message.setWrapperField(this, 1, value);
810 };
811
812
813 /**
814 * Clears the message field making it undefined.
815 * @return {!proto.routeguide.RouteNote} returns this
816 */
817 proto.routeguide.RouteNote.prototype.clearLocation = function() {
818 return this.setLocation(undefined);
819 };
820
821
822 /**
823 * Returns whether this field is set.
824 * @return {boolean}
825 */
826 proto.routeguide.RouteNote.prototype.hasLocation = function() {
827 return jspb.Message.getField(this, 1) != null;
828 };
829
830
831 /**
832 * optional string message = 2;
833 * @return {string}
834 */
835 proto.routeguide.RouteNote.prototype.getMessage = function() {
836 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
837 };
838
839
840 /**
841 * @param {string} value
842 * @return {!proto.routeguide.RouteNote} returns this
843 */
844 proto.routeguide.RouteNote.prototype.setMessage = function(value) {
845 return jspb.Message.setProto3StringField(this, 2, value);
846 };
847
848
849
850
851
852 if (jspb.Message.GENERATE_TO_OBJECT) {
853 /**
854 * Creates an object representation of this proto.
855 * Field names that are reserved in JavaScript and will be renamed to pb_name.
856 * Optional fields that are not set will be set to undefined.
857 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
858 * For the list of reserved names please see:
859 * net/proto2/compiler/js/internal/generator.cc#kKeyword.
860 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
861 * JSPB instance for transitional soy proto support:
862 * http://goto/soy-param-migration
863 * @return {!Object}
864 */
865 proto.routeguide.RouteSummary.prototype.toObject = function(opt_includeInstance) {
866 return proto.routeguide.RouteSummary.toObject(opt_includeInstance, this);
867 };
868
869
870 /**
871 * Static version of the {@see toObject} method.
872 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
873 * the JSPB instance for transitional soy proto support:
874 * http://goto/soy-param-migration
875 * @param {!proto.routeguide.RouteSummary} msg The msg instance to transform.
876 * @return {!Object}
877 * @suppress {unusedLocalVariables} f is only used for nested messages
878 */
879 proto.routeguide.RouteSummary.toObject = function(includeInstance, msg) {
880 var f, obj = {
881 pointCount: jspb.Message.getFieldWithDefault(msg, 1, 0),
882 featureCount: jspb.Message.getFieldWithDefault(msg, 2, 0),
883 distance: jspb.Message.getFieldWithDefault(msg, 3, 0),
884 elapsedTime: jspb.Message.getFieldWithDefault(msg, 4, 0)
885 };
886
887 if (includeInstance) {
888 obj.$jspbMessageInstance = msg;
889 }
890 return obj;
891 };
892 }
893
894
895 /**
896 * Deserializes binary data (in protobuf wire format).
897 * @param {jspb.ByteSource} bytes The bytes to deserialize.
898 * @return {!proto.routeguide.RouteSummary}
899 */
900 proto.routeguide.RouteSummary.deserializeBinary = function(bytes) {
901 var reader = new jspb.BinaryReader(bytes);
902 var msg = new proto.routeguide.RouteSummary;
903 return proto.routeguide.RouteSummary.deserializeBinaryFromReader(msg, reader);
904 };
905
906
907 /**
908 * Deserializes binary data (in protobuf wire format) from the
909 * given reader into the given message object.
910 * @param {!proto.routeguide.RouteSummary} msg The message object to deserialize into.
911 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
912 * @return {!proto.routeguide.RouteSummary}
913 */
914 proto.routeguide.RouteSummary.deserializeBinaryFromReader = function(msg, reader) {
915 while (reader.nextField()) {
916 if (reader.isEndGroup()) {
917 break;
918 }
919 var field = reader.getFieldNumber();
920 switch (field) {
921 case 1:
922 var value = /** @type {number} */ (reader.readInt32());
923 msg.setPointCount(value);
924 break;
925 case 2:
926 var value = /** @type {number} */ (reader.readInt32());
927 msg.setFeatureCount(value);
928 break;
929 case 3:
930 var value = /** @type {number} */ (reader.readInt32());
931 msg.setDistance(value);
932 break;
933 case 4:
934 var value = /** @type {number} */ (reader.readInt32());
935 msg.setElapsedTime(value);
936 break;
937 default:
938 reader.skipField();
939 break;
940 }
941 }
942 return msg;
943 };
944
945
946 /**
947 * Serializes the message to binary data (in protobuf wire format).
948 * @return {!Uint8Array}
949 */
950 proto.routeguide.RouteSummary.prototype.serializeBinary = function() {
951 var writer = new jspb.BinaryWriter();
952 proto.routeguide.RouteSummary.serializeBinaryToWriter(this, writer);
953 return writer.getResultBuffer();
954 };
955
956
957 /**
958 * Serializes the given message to binary data (in protobuf wire
959 * format), writing to the given BinaryWriter.
960 * @param {!proto.routeguide.RouteSummary} message
961 * @param {!jspb.BinaryWriter} writer
962 * @suppress {unusedLocalVariables} f is only used for nested messages
963 */
964 proto.routeguide.RouteSummary.serializeBinaryToWriter = function(message, writer) {
965 var f = undefined;
966 f = message.getPointCount();
967 if (f !== 0) {
968 writer.writeInt32(
969 1,
970 f
971 );
972 }
973 f = message.getFeatureCount();
974 if (f !== 0) {
975 writer.writeInt32(
976 2,
977 f
978 );
979 }
980 f = message.getDistance();
981 if (f !== 0) {
982 writer.writeInt32(
983 3,
984 f
985 );
986 }
987 f = message.getElapsedTime();
988 if (f !== 0) {
989 writer.writeInt32(
990 4,
991 f
992 );
993 }
994 };
995
996
997 /**
998 * optional int32 point_count = 1;
999 * @return {number}
1000 */
1001 proto.routeguide.RouteSummary.prototype.getPointCount = function() {
1002 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
1003 };
1004
1005
1006 /**
1007 * @param {number} value
1008 * @return {!proto.routeguide.RouteSummary} returns this
1009 */
1010 proto.routeguide.RouteSummary.prototype.setPointCount = function(value) {
1011 return jspb.Message.setProto3IntField(this, 1, value);
1012 };
1013
1014
1015 /**
1016 * optional int32 feature_count = 2;
1017 * @return {number}
1018 */
1019 proto.routeguide.RouteSummary.prototype.getFeatureCount = function() {
1020 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
1021 };
1022
1023
1024 /**
1025 * @param {number} value
1026 * @return {!proto.routeguide.RouteSummary} returns this
1027 */
1028 proto.routeguide.RouteSummary.prototype.setFeatureCount = function(value) {
1029 return jspb.Message.setProto3IntField(this, 2, value);
1030 };
1031
1032
1033 /**
1034 * optional int32 distance = 3;
1035 * @return {number}
1036 */
1037 proto.routeguide.RouteSummary.prototype.getDistance = function() {
1038 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
1039 };
1040
1041
1042 /**
1043 * @param {number} value
1044 * @return {!proto.routeguide.RouteSummary} returns this
1045 */
1046 proto.routeguide.RouteSummary.prototype.setDistance = function(value) {
1047 return jspb.Message.setProto3IntField(this, 3, value);
1048 };
1049
1050
1051 /**
1052 * optional int32 elapsed_time = 4;
1053 * @return {number}
1054 */
1055 proto.routeguide.RouteSummary.prototype.getElapsedTime = function() {
1056 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
1057 };
1058
1059
1060 /**
1061 * @param {number} value
1062 * @return {!proto.routeguide.RouteSummary} returns this
1063 */
1064 proto.routeguide.RouteSummary.prototype.setElapsedTime = function(value) {
1065 return jspb.Message.setProto3IntField(this, 4, value);
1066 };
1067
1068
1069 goog.object.extend(exports, proto.routeguide);