github.com/simpleiot/simpleiot@v0.18.3/frontend/lib/protobuf/point_pb.js (about) 1 // source: point.proto 2 /** 3 * @fileoverview 4 * @enhanceable 5 * @suppress {missingRequire} reports error on implicit type usages. 6 * @suppress {messageConventions} JS Compiler reports an error if a variable or 7 * field starts with 'MSG_' and isn't a translatable message. 8 * @public 9 */ 10 // GENERATED CODE -- DO NOT EDIT! 11 /* eslint-disable */ 12 // @ts-nocheck 13 14 var jspb = require('google-protobuf'); 15 var goog = jspb; 16 var global = 17 (typeof globalThis !== 'undefined' && globalThis) || 18 (typeof window !== 'undefined' && window) || 19 (typeof global !== 'undefined' && global) || 20 (typeof self !== 'undefined' && self) || 21 (function () { return this; }).call(null) || 22 Function('return this')(); 23 24 var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); 25 goog.object.extend(proto, google_protobuf_timestamp_pb); 26 goog.exportSymbol('proto.pb.Point', null, global); 27 goog.exportSymbol('proto.pb.PointArray', null, global); 28 goog.exportSymbol('proto.pb.Points', null, global); 29 goog.exportSymbol('proto.pb.SerialPoint', null, global); 30 goog.exportSymbol('proto.pb.SerialPoints', null, global); 31 /** 32 * Generated by JsPbCodeGenerator. 33 * @param {Array=} opt_data Optional initial data array, typically from a 34 * server response, or constructed directly in Javascript. The array is used 35 * in place and becomes part of the constructed object. It is not cloned. 36 * If no data is provided, the constructed object will be empty, but still 37 * valid. 38 * @extends {jspb.Message} 39 * @constructor 40 */ 41 proto.pb.Point = function(opt_data) { 42 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 43 }; 44 goog.inherits(proto.pb.Point, jspb.Message); 45 if (goog.DEBUG && !COMPILED) { 46 /** 47 * @public 48 * @override 49 */ 50 proto.pb.Point.displayName = 'proto.pb.Point'; 51 } 52 /** 53 * Generated by JsPbCodeGenerator. 54 * @param {Array=} opt_data Optional initial data array, typically from a 55 * server response, or constructed directly in Javascript. The array is used 56 * in place and becomes part of the constructed object. It is not cloned. 57 * If no data is provided, the constructed object will be empty, but still 58 * valid. 59 * @extends {jspb.Message} 60 * @constructor 61 */ 62 proto.pb.Points = function(opt_data) { 63 jspb.Message.initialize(this, opt_data, 0, -1, proto.pb.Points.repeatedFields_, null); 64 }; 65 goog.inherits(proto.pb.Points, jspb.Message); 66 if (goog.DEBUG && !COMPILED) { 67 /** 68 * @public 69 * @override 70 */ 71 proto.pb.Points.displayName = 'proto.pb.Points'; 72 } 73 /** 74 * Generated by JsPbCodeGenerator. 75 * @param {Array=} opt_data Optional initial data array, typically from a 76 * server response, or constructed directly in Javascript. The array is used 77 * in place and becomes part of the constructed object. It is not cloned. 78 * If no data is provided, the constructed object will be empty, but still 79 * valid. 80 * @extends {jspb.Message} 81 * @constructor 82 */ 83 proto.pb.SerialPoint = function(opt_data) { 84 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 85 }; 86 goog.inherits(proto.pb.SerialPoint, jspb.Message); 87 if (goog.DEBUG && !COMPILED) { 88 /** 89 * @public 90 * @override 91 */ 92 proto.pb.SerialPoint.displayName = 'proto.pb.SerialPoint'; 93 } 94 /** 95 * Generated by JsPbCodeGenerator. 96 * @param {Array=} opt_data Optional initial data array, typically from a 97 * server response, or constructed directly in Javascript. The array is used 98 * in place and becomes part of the constructed object. It is not cloned. 99 * If no data is provided, the constructed object will be empty, but still 100 * valid. 101 * @extends {jspb.Message} 102 * @constructor 103 */ 104 proto.pb.SerialPoints = function(opt_data) { 105 jspb.Message.initialize(this, opt_data, 0, -1, proto.pb.SerialPoints.repeatedFields_, null); 106 }; 107 goog.inherits(proto.pb.SerialPoints, jspb.Message); 108 if (goog.DEBUG && !COMPILED) { 109 /** 110 * @public 111 * @override 112 */ 113 proto.pb.SerialPoints.displayName = 'proto.pb.SerialPoints'; 114 } 115 /** 116 * Generated by JsPbCodeGenerator. 117 * @param {Array=} opt_data Optional initial data array, typically from a 118 * server response, or constructed directly in Javascript. The array is used 119 * in place and becomes part of the constructed object. It is not cloned. 120 * If no data is provided, the constructed object will be empty, but still 121 * valid. 122 * @extends {jspb.Message} 123 * @constructor 124 */ 125 proto.pb.PointArray = function(opt_data) { 126 jspb.Message.initialize(this, opt_data, 0, -1, proto.pb.PointArray.repeatedFields_, null); 127 }; 128 goog.inherits(proto.pb.PointArray, jspb.Message); 129 if (goog.DEBUG && !COMPILED) { 130 /** 131 * @public 132 * @override 133 */ 134 proto.pb.PointArray.displayName = 'proto.pb.PointArray'; 135 } 136 137 138 139 if (jspb.Message.GENERATE_TO_OBJECT) { 140 /** 141 * Creates an object representation of this proto. 142 * Field names that are reserved in JavaScript and will be renamed to pb_name. 143 * Optional fields that are not set will be set to undefined. 144 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 145 * For the list of reserved names please see: 146 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 147 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 148 * JSPB instance for transitional soy proto support: 149 * http://goto/soy-param-migration 150 * @return {!Object} 151 */ 152 proto.pb.Point.prototype.toObject = function(opt_includeInstance) { 153 return proto.pb.Point.toObject(opt_includeInstance, this); 154 }; 155 156 157 /** 158 * Static version of the {@see toObject} method. 159 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 160 * the JSPB instance for transitional soy proto support: 161 * http://goto/soy-param-migration 162 * @param {!proto.pb.Point} msg The msg instance to transform. 163 * @return {!Object} 164 * @suppress {unusedLocalVariables} f is only used for nested messages 165 */ 166 proto.pb.Point.toObject = function(includeInstance, msg) { 167 var f, obj = { 168 type: jspb.Message.getFieldWithDefault(msg, 2, ""), 169 value: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0), 170 time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), 171 text: jspb.Message.getFieldWithDefault(msg, 8, ""), 172 key: jspb.Message.getFieldWithDefault(msg, 11, ""), 173 tombstone: jspb.Message.getFieldWithDefault(msg, 12, 0), 174 data: msg.getData_asB64(), 175 origin: jspb.Message.getFieldWithDefault(msg, 15, "") 176 }; 177 178 if (includeInstance) { 179 obj.$jspbMessageInstance = msg; 180 } 181 return obj; 182 }; 183 } 184 185 186 /** 187 * Deserializes binary data (in protobuf wire format). 188 * @param {jspb.ByteSource} bytes The bytes to deserialize. 189 * @return {!proto.pb.Point} 190 */ 191 proto.pb.Point.deserializeBinary = function(bytes) { 192 var reader = new jspb.BinaryReader(bytes); 193 var msg = new proto.pb.Point; 194 return proto.pb.Point.deserializeBinaryFromReader(msg, reader); 195 }; 196 197 198 /** 199 * Deserializes binary data (in protobuf wire format) from the 200 * given reader into the given message object. 201 * @param {!proto.pb.Point} msg The message object to deserialize into. 202 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 203 * @return {!proto.pb.Point} 204 */ 205 proto.pb.Point.deserializeBinaryFromReader = function(msg, reader) { 206 while (reader.nextField()) { 207 if (reader.isEndGroup()) { 208 break; 209 } 210 var field = reader.getFieldNumber(); 211 switch (field) { 212 case 2: 213 var value = /** @type {string} */ (reader.readString()); 214 msg.setType(value); 215 break; 216 case 4: 217 var value = /** @type {number} */ (reader.readDouble()); 218 msg.setValue(value); 219 break; 220 case 5: 221 var value = new google_protobuf_timestamp_pb.Timestamp; 222 reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); 223 msg.setTime(value); 224 break; 225 case 8: 226 var value = /** @type {string} */ (reader.readString()); 227 msg.setText(value); 228 break; 229 case 11: 230 var value = /** @type {string} */ (reader.readString()); 231 msg.setKey(value); 232 break; 233 case 12: 234 var value = /** @type {number} */ (reader.readInt32()); 235 msg.setTombstone(value); 236 break; 237 case 14: 238 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 239 msg.setData(value); 240 break; 241 case 15: 242 var value = /** @type {string} */ (reader.readString()); 243 msg.setOrigin(value); 244 break; 245 default: 246 reader.skipField(); 247 break; 248 } 249 } 250 return msg; 251 }; 252 253 254 /** 255 * Serializes the message to binary data (in protobuf wire format). 256 * @return {!Uint8Array} 257 */ 258 proto.pb.Point.prototype.serializeBinary = function() { 259 var writer = new jspb.BinaryWriter(); 260 proto.pb.Point.serializeBinaryToWriter(this, writer); 261 return writer.getResultBuffer(); 262 }; 263 264 265 /** 266 * Serializes the given message to binary data (in protobuf wire 267 * format), writing to the given BinaryWriter. 268 * @param {!proto.pb.Point} message 269 * @param {!jspb.BinaryWriter} writer 270 * @suppress {unusedLocalVariables} f is only used for nested messages 271 */ 272 proto.pb.Point.serializeBinaryToWriter = function(message, writer) { 273 var f = undefined; 274 f = message.getType(); 275 if (f.length > 0) { 276 writer.writeString( 277 2, 278 f 279 ); 280 } 281 f = message.getValue(); 282 if (f !== 0.0) { 283 writer.writeDouble( 284 4, 285 f 286 ); 287 } 288 f = message.getTime(); 289 if (f != null) { 290 writer.writeMessage( 291 5, 292 f, 293 google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter 294 ); 295 } 296 f = message.getText(); 297 if (f.length > 0) { 298 writer.writeString( 299 8, 300 f 301 ); 302 } 303 f = message.getKey(); 304 if (f.length > 0) { 305 writer.writeString( 306 11, 307 f 308 ); 309 } 310 f = message.getTombstone(); 311 if (f !== 0) { 312 writer.writeInt32( 313 12, 314 f 315 ); 316 } 317 f = message.getData_asU8(); 318 if (f.length > 0) { 319 writer.writeBytes( 320 14, 321 f 322 ); 323 } 324 f = message.getOrigin(); 325 if (f.length > 0) { 326 writer.writeString( 327 15, 328 f 329 ); 330 } 331 }; 332 333 334 /** 335 * optional string type = 2; 336 * @return {string} 337 */ 338 proto.pb.Point.prototype.getType = function() { 339 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 340 }; 341 342 343 /** 344 * @param {string} value 345 * @return {!proto.pb.Point} returns this 346 */ 347 proto.pb.Point.prototype.setType = function(value) { 348 return jspb.Message.setProto3StringField(this, 2, value); 349 }; 350 351 352 /** 353 * optional double value = 4; 354 * @return {number} 355 */ 356 proto.pb.Point.prototype.getValue = function() { 357 return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0)); 358 }; 359 360 361 /** 362 * @param {number} value 363 * @return {!proto.pb.Point} returns this 364 */ 365 proto.pb.Point.prototype.setValue = function(value) { 366 return jspb.Message.setProto3FloatField(this, 4, value); 367 }; 368 369 370 /** 371 * optional google.protobuf.Timestamp time = 5; 372 * @return {?proto.google.protobuf.Timestamp} 373 */ 374 proto.pb.Point.prototype.getTime = function() { 375 return /** @type{?proto.google.protobuf.Timestamp} */ ( 376 jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 5)); 377 }; 378 379 380 /** 381 * @param {?proto.google.protobuf.Timestamp|undefined} value 382 * @return {!proto.pb.Point} returns this 383 */ 384 proto.pb.Point.prototype.setTime = function(value) { 385 return jspb.Message.setWrapperField(this, 5, value); 386 }; 387 388 389 /** 390 * Clears the message field making it undefined. 391 * @return {!proto.pb.Point} returns this 392 */ 393 proto.pb.Point.prototype.clearTime = function() { 394 return this.setTime(undefined); 395 }; 396 397 398 /** 399 * Returns whether this field is set. 400 * @return {boolean} 401 */ 402 proto.pb.Point.prototype.hasTime = function() { 403 return jspb.Message.getField(this, 5) != null; 404 }; 405 406 407 /** 408 * optional string text = 8; 409 * @return {string} 410 */ 411 proto.pb.Point.prototype.getText = function() { 412 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); 413 }; 414 415 416 /** 417 * @param {string} value 418 * @return {!proto.pb.Point} returns this 419 */ 420 proto.pb.Point.prototype.setText = function(value) { 421 return jspb.Message.setProto3StringField(this, 8, value); 422 }; 423 424 425 /** 426 * optional string key = 11; 427 * @return {string} 428 */ 429 proto.pb.Point.prototype.getKey = function() { 430 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); 431 }; 432 433 434 /** 435 * @param {string} value 436 * @return {!proto.pb.Point} returns this 437 */ 438 proto.pb.Point.prototype.setKey = function(value) { 439 return jspb.Message.setProto3StringField(this, 11, value); 440 }; 441 442 443 /** 444 * optional int32 tombstone = 12; 445 * @return {number} 446 */ 447 proto.pb.Point.prototype.getTombstone = function() { 448 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0)); 449 }; 450 451 452 /** 453 * @param {number} value 454 * @return {!proto.pb.Point} returns this 455 */ 456 proto.pb.Point.prototype.setTombstone = function(value) { 457 return jspb.Message.setProto3IntField(this, 12, value); 458 }; 459 460 461 /** 462 * optional bytes data = 14; 463 * @return {!(string|Uint8Array)} 464 */ 465 proto.pb.Point.prototype.getData = function() { 466 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 14, "")); 467 }; 468 469 470 /** 471 * optional bytes data = 14; 472 * This is a type-conversion wrapper around `getData()` 473 * @return {string} 474 */ 475 proto.pb.Point.prototype.getData_asB64 = function() { 476 return /** @type {string} */ (jspb.Message.bytesAsB64( 477 this.getData())); 478 }; 479 480 481 /** 482 * optional bytes data = 14; 483 * Note that Uint8Array is not supported on all browsers. 484 * @see http://caniuse.com/Uint8Array 485 * This is a type-conversion wrapper around `getData()` 486 * @return {!Uint8Array} 487 */ 488 proto.pb.Point.prototype.getData_asU8 = function() { 489 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 490 this.getData())); 491 }; 492 493 494 /** 495 * @param {!(string|Uint8Array)} value 496 * @return {!proto.pb.Point} returns this 497 */ 498 proto.pb.Point.prototype.setData = function(value) { 499 return jspb.Message.setProto3BytesField(this, 14, value); 500 }; 501 502 503 /** 504 * optional string origin = 15; 505 * @return {string} 506 */ 507 proto.pb.Point.prototype.getOrigin = function() { 508 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 15, "")); 509 }; 510 511 512 /** 513 * @param {string} value 514 * @return {!proto.pb.Point} returns this 515 */ 516 proto.pb.Point.prototype.setOrigin = function(value) { 517 return jspb.Message.setProto3StringField(this, 15, value); 518 }; 519 520 521 522 /** 523 * List of repeated fields within this message type. 524 * @private {!Array<number>} 525 * @const 526 */ 527 proto.pb.Points.repeatedFields_ = [1]; 528 529 530 531 if (jspb.Message.GENERATE_TO_OBJECT) { 532 /** 533 * Creates an object representation of this proto. 534 * Field names that are reserved in JavaScript and will be renamed to pb_name. 535 * Optional fields that are not set will be set to undefined. 536 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 537 * For the list of reserved names please see: 538 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 539 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 540 * JSPB instance for transitional soy proto support: 541 * http://goto/soy-param-migration 542 * @return {!Object} 543 */ 544 proto.pb.Points.prototype.toObject = function(opt_includeInstance) { 545 return proto.pb.Points.toObject(opt_includeInstance, this); 546 }; 547 548 549 /** 550 * Static version of the {@see toObject} method. 551 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 552 * the JSPB instance for transitional soy proto support: 553 * http://goto/soy-param-migration 554 * @param {!proto.pb.Points} msg The msg instance to transform. 555 * @return {!Object} 556 * @suppress {unusedLocalVariables} f is only used for nested messages 557 */ 558 proto.pb.Points.toObject = function(includeInstance, msg) { 559 var f, obj = { 560 pointsList: jspb.Message.toObjectList(msg.getPointsList(), 561 proto.pb.Point.toObject, includeInstance) 562 }; 563 564 if (includeInstance) { 565 obj.$jspbMessageInstance = msg; 566 } 567 return obj; 568 }; 569 } 570 571 572 /** 573 * Deserializes binary data (in protobuf wire format). 574 * @param {jspb.ByteSource} bytes The bytes to deserialize. 575 * @return {!proto.pb.Points} 576 */ 577 proto.pb.Points.deserializeBinary = function(bytes) { 578 var reader = new jspb.BinaryReader(bytes); 579 var msg = new proto.pb.Points; 580 return proto.pb.Points.deserializeBinaryFromReader(msg, reader); 581 }; 582 583 584 /** 585 * Deserializes binary data (in protobuf wire format) from the 586 * given reader into the given message object. 587 * @param {!proto.pb.Points} msg The message object to deserialize into. 588 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 589 * @return {!proto.pb.Points} 590 */ 591 proto.pb.Points.deserializeBinaryFromReader = function(msg, reader) { 592 while (reader.nextField()) { 593 if (reader.isEndGroup()) { 594 break; 595 } 596 var field = reader.getFieldNumber(); 597 switch (field) { 598 case 1: 599 var value = new proto.pb.Point; 600 reader.readMessage(value,proto.pb.Point.deserializeBinaryFromReader); 601 msg.addPoints(value); 602 break; 603 default: 604 reader.skipField(); 605 break; 606 } 607 } 608 return msg; 609 }; 610 611 612 /** 613 * Serializes the message to binary data (in protobuf wire format). 614 * @return {!Uint8Array} 615 */ 616 proto.pb.Points.prototype.serializeBinary = function() { 617 var writer = new jspb.BinaryWriter(); 618 proto.pb.Points.serializeBinaryToWriter(this, writer); 619 return writer.getResultBuffer(); 620 }; 621 622 623 /** 624 * Serializes the given message to binary data (in protobuf wire 625 * format), writing to the given BinaryWriter. 626 * @param {!proto.pb.Points} message 627 * @param {!jspb.BinaryWriter} writer 628 * @suppress {unusedLocalVariables} f is only used for nested messages 629 */ 630 proto.pb.Points.serializeBinaryToWriter = function(message, writer) { 631 var f = undefined; 632 f = message.getPointsList(); 633 if (f.length > 0) { 634 writer.writeRepeatedMessage( 635 1, 636 f, 637 proto.pb.Point.serializeBinaryToWriter 638 ); 639 } 640 }; 641 642 643 /** 644 * repeated Point points = 1; 645 * @return {!Array<!proto.pb.Point>} 646 */ 647 proto.pb.Points.prototype.getPointsList = function() { 648 return /** @type{!Array<!proto.pb.Point>} */ ( 649 jspb.Message.getRepeatedWrapperField(this, proto.pb.Point, 1)); 650 }; 651 652 653 /** 654 * @param {!Array<!proto.pb.Point>} value 655 * @return {!proto.pb.Points} returns this 656 */ 657 proto.pb.Points.prototype.setPointsList = function(value) { 658 return jspb.Message.setRepeatedWrapperField(this, 1, value); 659 }; 660 661 662 /** 663 * @param {!proto.pb.Point=} opt_value 664 * @param {number=} opt_index 665 * @return {!proto.pb.Point} 666 */ 667 proto.pb.Points.prototype.addPoints = function(opt_value, opt_index) { 668 return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pb.Point, opt_index); 669 }; 670 671 672 /** 673 * Clears the list making it empty but non-null. 674 * @return {!proto.pb.Points} returns this 675 */ 676 proto.pb.Points.prototype.clearPointsList = function() { 677 return this.setPointsList([]); 678 }; 679 680 681 682 683 684 if (jspb.Message.GENERATE_TO_OBJECT) { 685 /** 686 * Creates an object representation of this proto. 687 * Field names that are reserved in JavaScript and will be renamed to pb_name. 688 * Optional fields that are not set will be set to undefined. 689 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 690 * For the list of reserved names please see: 691 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 692 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 693 * JSPB instance for transitional soy proto support: 694 * http://goto/soy-param-migration 695 * @return {!Object} 696 */ 697 proto.pb.SerialPoint.prototype.toObject = function(opt_includeInstance) { 698 return proto.pb.SerialPoint.toObject(opt_includeInstance, this); 699 }; 700 701 702 /** 703 * Static version of the {@see toObject} method. 704 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 705 * the JSPB instance for transitional soy proto support: 706 * http://goto/soy-param-migration 707 * @param {!proto.pb.SerialPoint} msg The msg instance to transform. 708 * @return {!Object} 709 * @suppress {unusedLocalVariables} f is only used for nested messages 710 */ 711 proto.pb.SerialPoint.toObject = function(includeInstance, msg) { 712 var f, obj = { 713 type: jspb.Message.getFieldWithDefault(msg, 2, ""), 714 value: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0), 715 time: jspb.Message.getFieldWithDefault(msg, 16, 0), 716 text: jspb.Message.getFieldWithDefault(msg, 8, ""), 717 key: jspb.Message.getFieldWithDefault(msg, 11, ""), 718 tombstone: jspb.Message.getFieldWithDefault(msg, 12, 0), 719 data: msg.getData_asB64(), 720 origin: jspb.Message.getFieldWithDefault(msg, 15, "") 721 }; 722 723 if (includeInstance) { 724 obj.$jspbMessageInstance = msg; 725 } 726 return obj; 727 }; 728 } 729 730 731 /** 732 * Deserializes binary data (in protobuf wire format). 733 * @param {jspb.ByteSource} bytes The bytes to deserialize. 734 * @return {!proto.pb.SerialPoint} 735 */ 736 proto.pb.SerialPoint.deserializeBinary = function(bytes) { 737 var reader = new jspb.BinaryReader(bytes); 738 var msg = new proto.pb.SerialPoint; 739 return proto.pb.SerialPoint.deserializeBinaryFromReader(msg, reader); 740 }; 741 742 743 /** 744 * Deserializes binary data (in protobuf wire format) from the 745 * given reader into the given message object. 746 * @param {!proto.pb.SerialPoint} msg The message object to deserialize into. 747 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 748 * @return {!proto.pb.SerialPoint} 749 */ 750 proto.pb.SerialPoint.deserializeBinaryFromReader = function(msg, reader) { 751 while (reader.nextField()) { 752 if (reader.isEndGroup()) { 753 break; 754 } 755 var field = reader.getFieldNumber(); 756 switch (field) { 757 case 2: 758 var value = /** @type {string} */ (reader.readString()); 759 msg.setType(value); 760 break; 761 case 4: 762 var value = /** @type {number} */ (reader.readFloat()); 763 msg.setValue(value); 764 break; 765 case 16: 766 var value = /** @type {number} */ (reader.readInt64()); 767 msg.setTime(value); 768 break; 769 case 8: 770 var value = /** @type {string} */ (reader.readString()); 771 msg.setText(value); 772 break; 773 case 11: 774 var value = /** @type {string} */ (reader.readString()); 775 msg.setKey(value); 776 break; 777 case 12: 778 var value = /** @type {number} */ (reader.readInt32()); 779 msg.setTombstone(value); 780 break; 781 case 14: 782 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 783 msg.setData(value); 784 break; 785 case 15: 786 var value = /** @type {string} */ (reader.readString()); 787 msg.setOrigin(value); 788 break; 789 default: 790 reader.skipField(); 791 break; 792 } 793 } 794 return msg; 795 }; 796 797 798 /** 799 * Serializes the message to binary data (in protobuf wire format). 800 * @return {!Uint8Array} 801 */ 802 proto.pb.SerialPoint.prototype.serializeBinary = function() { 803 var writer = new jspb.BinaryWriter(); 804 proto.pb.SerialPoint.serializeBinaryToWriter(this, writer); 805 return writer.getResultBuffer(); 806 }; 807 808 809 /** 810 * Serializes the given message to binary data (in protobuf wire 811 * format), writing to the given BinaryWriter. 812 * @param {!proto.pb.SerialPoint} message 813 * @param {!jspb.BinaryWriter} writer 814 * @suppress {unusedLocalVariables} f is only used for nested messages 815 */ 816 proto.pb.SerialPoint.serializeBinaryToWriter = function(message, writer) { 817 var f = undefined; 818 f = message.getType(); 819 if (f.length > 0) { 820 writer.writeString( 821 2, 822 f 823 ); 824 } 825 f = message.getValue(); 826 if (f !== 0.0) { 827 writer.writeFloat( 828 4, 829 f 830 ); 831 } 832 f = message.getTime(); 833 if (f !== 0) { 834 writer.writeInt64( 835 16, 836 f 837 ); 838 } 839 f = message.getText(); 840 if (f.length > 0) { 841 writer.writeString( 842 8, 843 f 844 ); 845 } 846 f = message.getKey(); 847 if (f.length > 0) { 848 writer.writeString( 849 11, 850 f 851 ); 852 } 853 f = message.getTombstone(); 854 if (f !== 0) { 855 writer.writeInt32( 856 12, 857 f 858 ); 859 } 860 f = message.getData_asU8(); 861 if (f.length > 0) { 862 writer.writeBytes( 863 14, 864 f 865 ); 866 } 867 f = message.getOrigin(); 868 if (f.length > 0) { 869 writer.writeString( 870 15, 871 f 872 ); 873 } 874 }; 875 876 877 /** 878 * optional string type = 2; 879 * @return {string} 880 */ 881 proto.pb.SerialPoint.prototype.getType = function() { 882 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 883 }; 884 885 886 /** 887 * @param {string} value 888 * @return {!proto.pb.SerialPoint} returns this 889 */ 890 proto.pb.SerialPoint.prototype.setType = function(value) { 891 return jspb.Message.setProto3StringField(this, 2, value); 892 }; 893 894 895 /** 896 * optional float value = 4; 897 * @return {number} 898 */ 899 proto.pb.SerialPoint.prototype.getValue = function() { 900 return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0)); 901 }; 902 903 904 /** 905 * @param {number} value 906 * @return {!proto.pb.SerialPoint} returns this 907 */ 908 proto.pb.SerialPoint.prototype.setValue = function(value) { 909 return jspb.Message.setProto3FloatField(this, 4, value); 910 }; 911 912 913 /** 914 * optional int64 time = 16; 915 * @return {number} 916 */ 917 proto.pb.SerialPoint.prototype.getTime = function() { 918 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 16, 0)); 919 }; 920 921 922 /** 923 * @param {number} value 924 * @return {!proto.pb.SerialPoint} returns this 925 */ 926 proto.pb.SerialPoint.prototype.setTime = function(value) { 927 return jspb.Message.setProto3IntField(this, 16, value); 928 }; 929 930 931 /** 932 * optional string text = 8; 933 * @return {string} 934 */ 935 proto.pb.SerialPoint.prototype.getText = function() { 936 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 8, "")); 937 }; 938 939 940 /** 941 * @param {string} value 942 * @return {!proto.pb.SerialPoint} returns this 943 */ 944 proto.pb.SerialPoint.prototype.setText = function(value) { 945 return jspb.Message.setProto3StringField(this, 8, value); 946 }; 947 948 949 /** 950 * optional string key = 11; 951 * @return {string} 952 */ 953 proto.pb.SerialPoint.prototype.getKey = function() { 954 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, "")); 955 }; 956 957 958 /** 959 * @param {string} value 960 * @return {!proto.pb.SerialPoint} returns this 961 */ 962 proto.pb.SerialPoint.prototype.setKey = function(value) { 963 return jspb.Message.setProto3StringField(this, 11, value); 964 }; 965 966 967 /** 968 * optional int32 tombstone = 12; 969 * @return {number} 970 */ 971 proto.pb.SerialPoint.prototype.getTombstone = function() { 972 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 12, 0)); 973 }; 974 975 976 /** 977 * @param {number} value 978 * @return {!proto.pb.SerialPoint} returns this 979 */ 980 proto.pb.SerialPoint.prototype.setTombstone = function(value) { 981 return jspb.Message.setProto3IntField(this, 12, value); 982 }; 983 984 985 /** 986 * optional bytes data = 14; 987 * @return {!(string|Uint8Array)} 988 */ 989 proto.pb.SerialPoint.prototype.getData = function() { 990 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 14, "")); 991 }; 992 993 994 /** 995 * optional bytes data = 14; 996 * This is a type-conversion wrapper around `getData()` 997 * @return {string} 998 */ 999 proto.pb.SerialPoint.prototype.getData_asB64 = function() { 1000 return /** @type {string} */ (jspb.Message.bytesAsB64( 1001 this.getData())); 1002 }; 1003 1004 1005 /** 1006 * optional bytes data = 14; 1007 * Note that Uint8Array is not supported on all browsers. 1008 * @see http://caniuse.com/Uint8Array 1009 * This is a type-conversion wrapper around `getData()` 1010 * @return {!Uint8Array} 1011 */ 1012 proto.pb.SerialPoint.prototype.getData_asU8 = function() { 1013 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 1014 this.getData())); 1015 }; 1016 1017 1018 /** 1019 * @param {!(string|Uint8Array)} value 1020 * @return {!proto.pb.SerialPoint} returns this 1021 */ 1022 proto.pb.SerialPoint.prototype.setData = function(value) { 1023 return jspb.Message.setProto3BytesField(this, 14, value); 1024 }; 1025 1026 1027 /** 1028 * optional string origin = 15; 1029 * @return {string} 1030 */ 1031 proto.pb.SerialPoint.prototype.getOrigin = function() { 1032 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 15, "")); 1033 }; 1034 1035 1036 /** 1037 * @param {string} value 1038 * @return {!proto.pb.SerialPoint} returns this 1039 */ 1040 proto.pb.SerialPoint.prototype.setOrigin = function(value) { 1041 return jspb.Message.setProto3StringField(this, 15, value); 1042 }; 1043 1044 1045 1046 /** 1047 * List of repeated fields within this message type. 1048 * @private {!Array<number>} 1049 * @const 1050 */ 1051 proto.pb.SerialPoints.repeatedFields_ = [1]; 1052 1053 1054 1055 if (jspb.Message.GENERATE_TO_OBJECT) { 1056 /** 1057 * Creates an object representation of this proto. 1058 * Field names that are reserved in JavaScript and will be renamed to pb_name. 1059 * Optional fields that are not set will be set to undefined. 1060 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 1061 * For the list of reserved names please see: 1062 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 1063 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 1064 * JSPB instance for transitional soy proto support: 1065 * http://goto/soy-param-migration 1066 * @return {!Object} 1067 */ 1068 proto.pb.SerialPoints.prototype.toObject = function(opt_includeInstance) { 1069 return proto.pb.SerialPoints.toObject(opt_includeInstance, this); 1070 }; 1071 1072 1073 /** 1074 * Static version of the {@see toObject} method. 1075 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 1076 * the JSPB instance for transitional soy proto support: 1077 * http://goto/soy-param-migration 1078 * @param {!proto.pb.SerialPoints} msg The msg instance to transform. 1079 * @return {!Object} 1080 * @suppress {unusedLocalVariables} f is only used for nested messages 1081 */ 1082 proto.pb.SerialPoints.toObject = function(includeInstance, msg) { 1083 var f, obj = { 1084 pointsList: jspb.Message.toObjectList(msg.getPointsList(), 1085 proto.pb.SerialPoint.toObject, includeInstance) 1086 }; 1087 1088 if (includeInstance) { 1089 obj.$jspbMessageInstance = msg; 1090 } 1091 return obj; 1092 }; 1093 } 1094 1095 1096 /** 1097 * Deserializes binary data (in protobuf wire format). 1098 * @param {jspb.ByteSource} bytes The bytes to deserialize. 1099 * @return {!proto.pb.SerialPoints} 1100 */ 1101 proto.pb.SerialPoints.deserializeBinary = function(bytes) { 1102 var reader = new jspb.BinaryReader(bytes); 1103 var msg = new proto.pb.SerialPoints; 1104 return proto.pb.SerialPoints.deserializeBinaryFromReader(msg, reader); 1105 }; 1106 1107 1108 /** 1109 * Deserializes binary data (in protobuf wire format) from the 1110 * given reader into the given message object. 1111 * @param {!proto.pb.SerialPoints} msg The message object to deserialize into. 1112 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 1113 * @return {!proto.pb.SerialPoints} 1114 */ 1115 proto.pb.SerialPoints.deserializeBinaryFromReader = function(msg, reader) { 1116 while (reader.nextField()) { 1117 if (reader.isEndGroup()) { 1118 break; 1119 } 1120 var field = reader.getFieldNumber(); 1121 switch (field) { 1122 case 1: 1123 var value = new proto.pb.SerialPoint; 1124 reader.readMessage(value,proto.pb.SerialPoint.deserializeBinaryFromReader); 1125 msg.addPoints(value); 1126 break; 1127 default: 1128 reader.skipField(); 1129 break; 1130 } 1131 } 1132 return msg; 1133 }; 1134 1135 1136 /** 1137 * Serializes the message to binary data (in protobuf wire format). 1138 * @return {!Uint8Array} 1139 */ 1140 proto.pb.SerialPoints.prototype.serializeBinary = function() { 1141 var writer = new jspb.BinaryWriter(); 1142 proto.pb.SerialPoints.serializeBinaryToWriter(this, writer); 1143 return writer.getResultBuffer(); 1144 }; 1145 1146 1147 /** 1148 * Serializes the given message to binary data (in protobuf wire 1149 * format), writing to the given BinaryWriter. 1150 * @param {!proto.pb.SerialPoints} message 1151 * @param {!jspb.BinaryWriter} writer 1152 * @suppress {unusedLocalVariables} f is only used for nested messages 1153 */ 1154 proto.pb.SerialPoints.serializeBinaryToWriter = function(message, writer) { 1155 var f = undefined; 1156 f = message.getPointsList(); 1157 if (f.length > 0) { 1158 writer.writeRepeatedMessage( 1159 1, 1160 f, 1161 proto.pb.SerialPoint.serializeBinaryToWriter 1162 ); 1163 } 1164 }; 1165 1166 1167 /** 1168 * repeated SerialPoint points = 1; 1169 * @return {!Array<!proto.pb.SerialPoint>} 1170 */ 1171 proto.pb.SerialPoints.prototype.getPointsList = function() { 1172 return /** @type{!Array<!proto.pb.SerialPoint>} */ ( 1173 jspb.Message.getRepeatedWrapperField(this, proto.pb.SerialPoint, 1)); 1174 }; 1175 1176 1177 /** 1178 * @param {!Array<!proto.pb.SerialPoint>} value 1179 * @return {!proto.pb.SerialPoints} returns this 1180 */ 1181 proto.pb.SerialPoints.prototype.setPointsList = function(value) { 1182 return jspb.Message.setRepeatedWrapperField(this, 1, value); 1183 }; 1184 1185 1186 /** 1187 * @param {!proto.pb.SerialPoint=} opt_value 1188 * @param {number=} opt_index 1189 * @return {!proto.pb.SerialPoint} 1190 */ 1191 proto.pb.SerialPoints.prototype.addPoints = function(opt_value, opt_index) { 1192 return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.pb.SerialPoint, opt_index); 1193 }; 1194 1195 1196 /** 1197 * Clears the list making it empty but non-null. 1198 * @return {!proto.pb.SerialPoints} returns this 1199 */ 1200 proto.pb.SerialPoints.prototype.clearPointsList = function() { 1201 return this.setPointsList([]); 1202 }; 1203 1204 1205 1206 /** 1207 * List of repeated fields within this message type. 1208 * @private {!Array<number>} 1209 * @const 1210 */ 1211 proto.pb.PointArray.repeatedFields_ = [5]; 1212 1213 1214 1215 if (jspb.Message.GENERATE_TO_OBJECT) { 1216 /** 1217 * Creates an object representation of this proto. 1218 * Field names that are reserved in JavaScript and will be renamed to pb_name. 1219 * Optional fields that are not set will be set to undefined. 1220 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 1221 * For the list of reserved names please see: 1222 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 1223 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 1224 * JSPB instance for transitional soy proto support: 1225 * http://goto/soy-param-migration 1226 * @return {!Object} 1227 */ 1228 proto.pb.PointArray.prototype.toObject = function(opt_includeInstance) { 1229 return proto.pb.PointArray.toObject(opt_includeInstance, this); 1230 }; 1231 1232 1233 /** 1234 * Static version of the {@see toObject} method. 1235 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 1236 * the JSPB instance for transitional soy proto support: 1237 * http://goto/soy-param-migration 1238 * @param {!proto.pb.PointArray} msg The msg instance to transform. 1239 * @return {!Object} 1240 * @suppress {unusedLocalVariables} f is only used for nested messages 1241 */ 1242 proto.pb.PointArray.toObject = function(includeInstance, msg) { 1243 var f, obj = { 1244 starttime: jspb.Message.getFieldWithDefault(msg, 1, 0), 1245 type: jspb.Message.getFieldWithDefault(msg, 2, ""), 1246 key: jspb.Message.getFieldWithDefault(msg, 3, ""), 1247 samplerate: jspb.Message.getFloatingPointFieldWithDefault(msg, 4, 0.0), 1248 valuesList: (f = jspb.Message.getRepeatedFloatingPointField(msg, 5)) == null ? undefined : f 1249 }; 1250 1251 if (includeInstance) { 1252 obj.$jspbMessageInstance = msg; 1253 } 1254 return obj; 1255 }; 1256 } 1257 1258 1259 /** 1260 * Deserializes binary data (in protobuf wire format). 1261 * @param {jspb.ByteSource} bytes The bytes to deserialize. 1262 * @return {!proto.pb.PointArray} 1263 */ 1264 proto.pb.PointArray.deserializeBinary = function(bytes) { 1265 var reader = new jspb.BinaryReader(bytes); 1266 var msg = new proto.pb.PointArray; 1267 return proto.pb.PointArray.deserializeBinaryFromReader(msg, reader); 1268 }; 1269 1270 1271 /** 1272 * Deserializes binary data (in protobuf wire format) from the 1273 * given reader into the given message object. 1274 * @param {!proto.pb.PointArray} msg The message object to deserialize into. 1275 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 1276 * @return {!proto.pb.PointArray} 1277 */ 1278 proto.pb.PointArray.deserializeBinaryFromReader = function(msg, reader) { 1279 while (reader.nextField()) { 1280 if (reader.isEndGroup()) { 1281 break; 1282 } 1283 var field = reader.getFieldNumber(); 1284 switch (field) { 1285 case 1: 1286 var value = /** @type {number} */ (reader.readUint64()); 1287 msg.setStarttime(value); 1288 break; 1289 case 2: 1290 var value = /** @type {string} */ (reader.readString()); 1291 msg.setType(value); 1292 break; 1293 case 3: 1294 var value = /** @type {string} */ (reader.readString()); 1295 msg.setKey(value); 1296 break; 1297 case 4: 1298 var value = /** @type {number} */ (reader.readFloat()); 1299 msg.setSamplerate(value); 1300 break; 1301 case 5: 1302 var values = /** @type {!Array<number>} */ (reader.isDelimited() ? reader.readPackedFloat() : [reader.readFloat()]); 1303 for (var i = 0; i < values.length; i++) { 1304 msg.addValues(values[i]); 1305 } 1306 break; 1307 default: 1308 reader.skipField(); 1309 break; 1310 } 1311 } 1312 return msg; 1313 }; 1314 1315 1316 /** 1317 * Serializes the message to binary data (in protobuf wire format). 1318 * @return {!Uint8Array} 1319 */ 1320 proto.pb.PointArray.prototype.serializeBinary = function() { 1321 var writer = new jspb.BinaryWriter(); 1322 proto.pb.PointArray.serializeBinaryToWriter(this, writer); 1323 return writer.getResultBuffer(); 1324 }; 1325 1326 1327 /** 1328 * Serializes the given message to binary data (in protobuf wire 1329 * format), writing to the given BinaryWriter. 1330 * @param {!proto.pb.PointArray} message 1331 * @param {!jspb.BinaryWriter} writer 1332 * @suppress {unusedLocalVariables} f is only used for nested messages 1333 */ 1334 proto.pb.PointArray.serializeBinaryToWriter = function(message, writer) { 1335 var f = undefined; 1336 f = message.getStarttime(); 1337 if (f !== 0) { 1338 writer.writeUint64( 1339 1, 1340 f 1341 ); 1342 } 1343 f = message.getType(); 1344 if (f.length > 0) { 1345 writer.writeString( 1346 2, 1347 f 1348 ); 1349 } 1350 f = message.getKey(); 1351 if (f.length > 0) { 1352 writer.writeString( 1353 3, 1354 f 1355 ); 1356 } 1357 f = message.getSamplerate(); 1358 if (f !== 0.0) { 1359 writer.writeFloat( 1360 4, 1361 f 1362 ); 1363 } 1364 f = message.getValuesList(); 1365 if (f.length > 0) { 1366 writer.writePackedFloat( 1367 5, 1368 f 1369 ); 1370 } 1371 }; 1372 1373 1374 /** 1375 * optional uint64 starttime = 1; 1376 * @return {number} 1377 */ 1378 proto.pb.PointArray.prototype.getStarttime = function() { 1379 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); 1380 }; 1381 1382 1383 /** 1384 * @param {number} value 1385 * @return {!proto.pb.PointArray} returns this 1386 */ 1387 proto.pb.PointArray.prototype.setStarttime = function(value) { 1388 return jspb.Message.setProto3IntField(this, 1, value); 1389 }; 1390 1391 1392 /** 1393 * optional string type = 2; 1394 * @return {string} 1395 */ 1396 proto.pb.PointArray.prototype.getType = function() { 1397 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 1398 }; 1399 1400 1401 /** 1402 * @param {string} value 1403 * @return {!proto.pb.PointArray} returns this 1404 */ 1405 proto.pb.PointArray.prototype.setType = function(value) { 1406 return jspb.Message.setProto3StringField(this, 2, value); 1407 }; 1408 1409 1410 /** 1411 * optional string key = 3; 1412 * @return {string} 1413 */ 1414 proto.pb.PointArray.prototype.getKey = function() { 1415 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); 1416 }; 1417 1418 1419 /** 1420 * @param {string} value 1421 * @return {!proto.pb.PointArray} returns this 1422 */ 1423 proto.pb.PointArray.prototype.setKey = function(value) { 1424 return jspb.Message.setProto3StringField(this, 3, value); 1425 }; 1426 1427 1428 /** 1429 * optional float samplerate = 4; 1430 * @return {number} 1431 */ 1432 proto.pb.PointArray.prototype.getSamplerate = function() { 1433 return /** @type {number} */ (jspb.Message.getFloatingPointFieldWithDefault(this, 4, 0.0)); 1434 }; 1435 1436 1437 /** 1438 * @param {number} value 1439 * @return {!proto.pb.PointArray} returns this 1440 */ 1441 proto.pb.PointArray.prototype.setSamplerate = function(value) { 1442 return jspb.Message.setProto3FloatField(this, 4, value); 1443 }; 1444 1445 1446 /** 1447 * repeated float values = 5; 1448 * @return {!Array<number>} 1449 */ 1450 proto.pb.PointArray.prototype.getValuesList = function() { 1451 return /** @type {!Array<number>} */ (jspb.Message.getRepeatedFloatingPointField(this, 5)); 1452 }; 1453 1454 1455 /** 1456 * @param {!Array<number>} value 1457 * @return {!proto.pb.PointArray} returns this 1458 */ 1459 proto.pb.PointArray.prototype.setValuesList = function(value) { 1460 return jspb.Message.setField(this, 5, value || []); 1461 }; 1462 1463 1464 /** 1465 * @param {number} value 1466 * @param {number=} opt_index 1467 * @return {!proto.pb.PointArray} returns this 1468 */ 1469 proto.pb.PointArray.prototype.addValues = function(value, opt_index) { 1470 return jspb.Message.addToRepeatedField(this, 5, value, opt_index); 1471 }; 1472 1473 1474 /** 1475 * Clears the list making it empty but non-null. 1476 * @return {!proto.pb.PointArray} returns this 1477 */ 1478 proto.pb.PointArray.prototype.clearValuesList = function() { 1479 return this.setValuesList([]); 1480 }; 1481 1482 1483 goog.object.extend(exports, proto.pb);