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