murgatroid99 | 4c8f8d8 | 2016-02-26 11:43:05 -0800 | [diff] [blame] | 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.helloworld.HelloReply', null, global); |
| 13 | goog.exportSymbol('proto.helloworld.HelloRequest', null, global); |
| 14 | |
| 15 | /** |
| 16 | * Generated by JsPbCodeGenerator. |
| 17 | * @param {Array=} opt_data Optional initial data array, typically from a |
| 18 | * server response, or constructed directly in Javascript. The array is used |
| 19 | * in place and becomes part of the constructed object. It is not cloned. |
| 20 | * If no data is provided, the constructed object will be empty, but still |
| 21 | * valid. |
| 22 | * @extends {jspb.Message} |
| 23 | * @constructor |
| 24 | */ |
| 25 | proto.helloworld.HelloRequest = function(opt_data) { |
| 26 | jspb.Message.initialize(this, opt_data, 0, -1, null, null); |
| 27 | }; |
| 28 | goog.inherits(proto.helloworld.HelloRequest, jspb.Message); |
| 29 | if (goog.DEBUG && !COMPILED) { |
| 30 | proto.helloworld.HelloRequest.displayName = 'proto.helloworld.HelloRequest'; |
| 31 | } |
| 32 | |
| 33 | |
| 34 | if (jspb.Message.GENERATE_TO_OBJECT) { |
| 35 | /** |
| 36 | * Creates an object representation of this proto suitable for use in Soy templates. |
| 37 | * Field names that are reserved in JavaScript and will be renamed to pb_name. |
| 38 | * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. |
| 39 | * For the list of reserved names please see: |
| 40 | * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. |
| 41 | * @param {boolean=} opt_includeInstance Whether to include the JSPB instance |
| 42 | * for transitional soy proto support: http://goto/soy-param-migration |
| 43 | * @return {!Object} |
| 44 | */ |
| 45 | proto.helloworld.HelloRequest.prototype.toObject = function(opt_includeInstance) { |
| 46 | return proto.helloworld.HelloRequest.toObject(opt_includeInstance, this); |
| 47 | }; |
| 48 | |
| 49 | |
| 50 | /** |
| 51 | * Static version of the {@see toObject} method. |
| 52 | * @param {boolean|undefined} includeInstance Whether to include the JSPB |
| 53 | * instance for transitional soy proto support: |
| 54 | * http://goto/soy-param-migration |
| 55 | * @param {!proto.helloworld.HelloRequest} msg The msg instance to transform. |
| 56 | * @return {!Object} |
| 57 | */ |
| 58 | proto.helloworld.HelloRequest.toObject = function(includeInstance, msg) { |
| 59 | var f, obj = { |
| 60 | name: msg.getName() |
| 61 | }; |
| 62 | |
| 63 | if (includeInstance) { |
| 64 | obj.$jspbMessageInstance = msg |
| 65 | } |
| 66 | return obj; |
| 67 | }; |
| 68 | } |
| 69 | |
| 70 | |
| 71 | /** |
| 72 | * Deserializes binary data (in protobuf wire format). |
| 73 | * @param {jspb.ByteSource} bytes The bytes to deserialize. |
| 74 | * @return {!proto.helloworld.HelloRequest} |
| 75 | */ |
| 76 | proto.helloworld.HelloRequest.deserializeBinary = function(bytes) { |
| 77 | var reader = new jspb.BinaryReader(bytes); |
| 78 | var msg = new proto.helloworld.HelloRequest; |
| 79 | return proto.helloworld.HelloRequest.deserializeBinaryFromReader(msg, reader); |
| 80 | }; |
| 81 | |
| 82 | |
| 83 | /** |
| 84 | * Deserializes binary data (in protobuf wire format) from the |
| 85 | * given reader into the given message object. |
| 86 | * @param {!proto.helloworld.HelloRequest} msg The message object to deserialize into. |
| 87 | * @param {!jspb.BinaryReader} reader The BinaryReader to use. |
| 88 | * @return {!proto.helloworld.HelloRequest} |
| 89 | */ |
| 90 | proto.helloworld.HelloRequest.deserializeBinaryFromReader = function(msg, reader) { |
| 91 | while (reader.nextField()) { |
| 92 | if (reader.isEndGroup()) { |
| 93 | break; |
| 94 | } |
| 95 | var field = reader.getFieldNumber(); |
| 96 | switch (field) { |
| 97 | case 1: |
| 98 | var value = /** @type {string} */ (reader.readString()); |
| 99 | msg.setName(value); |
| 100 | break; |
| 101 | default: |
| 102 | reader.skipField(); |
| 103 | break; |
| 104 | } |
| 105 | } |
| 106 | return msg; |
| 107 | }; |
| 108 | |
| 109 | |
| 110 | /** |
| 111 | * Class method variant: serializes the given message to binary data |
| 112 | * (in protobuf wire format), writing to the given BinaryWriter. |
| 113 | * @param {!proto.helloworld.HelloRequest} message |
| 114 | * @param {!jspb.BinaryWriter} writer |
| 115 | */ |
| 116 | proto.helloworld.HelloRequest.serializeBinaryToWriter = function(message, writer) { |
| 117 | message.serializeBinaryToWriter(writer); |
| 118 | }; |
| 119 | |
| 120 | |
| 121 | /** |
| 122 | * Serializes the message to binary data (in protobuf wire format). |
| 123 | * @return {!Uint8Array} |
| 124 | */ |
| 125 | proto.helloworld.HelloRequest.prototype.serializeBinary = function() { |
| 126 | var writer = new jspb.BinaryWriter(); |
| 127 | this.serializeBinaryToWriter(writer); |
| 128 | return writer.getResultBuffer(); |
| 129 | }; |
| 130 | |
| 131 | |
| 132 | /** |
| 133 | * Serializes the message to binary data (in protobuf wire format), |
| 134 | * writing to the given BinaryWriter. |
| 135 | * @param {!jspb.BinaryWriter} writer |
| 136 | */ |
| 137 | proto.helloworld.HelloRequest.prototype.serializeBinaryToWriter = function (writer) { |
| 138 | var f = undefined; |
| 139 | f = this.getName(); |
| 140 | if (f.length > 0) { |
| 141 | writer.writeString( |
| 142 | 1, |
| 143 | f |
| 144 | ); |
| 145 | } |
| 146 | }; |
| 147 | |
| 148 | |
| 149 | /** |
| 150 | * Creates a deep clone of this proto. No data is shared with the original. |
| 151 | * @return {!proto.helloworld.HelloRequest} The clone. |
| 152 | */ |
| 153 | proto.helloworld.HelloRequest.prototype.cloneMessage = function() { |
| 154 | return /** @type {!proto.helloworld.HelloRequest} */ (jspb.Message.cloneMessage(this)); |
| 155 | }; |
| 156 | |
| 157 | |
| 158 | /** |
| 159 | * optional string name = 1; |
| 160 | * @return {string} |
| 161 | */ |
| 162 | proto.helloworld.HelloRequest.prototype.getName = function() { |
| 163 | return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, "")); |
| 164 | }; |
| 165 | |
| 166 | |
| 167 | /** @param {string} value */ |
| 168 | proto.helloworld.HelloRequest.prototype.setName = function(value) { |
| 169 | jspb.Message.setField(this, 1, value); |
| 170 | }; |
| 171 | |
| 172 | |
| 173 | |
| 174 | /** |
| 175 | * Generated by JsPbCodeGenerator. |
| 176 | * @param {Array=} opt_data Optional initial data array, typically from a |
| 177 | * server response, or constructed directly in Javascript. The array is used |
| 178 | * in place and becomes part of the constructed object. It is not cloned. |
| 179 | * If no data is provided, the constructed object will be empty, but still |
| 180 | * valid. |
| 181 | * @extends {jspb.Message} |
| 182 | * @constructor |
| 183 | */ |
| 184 | proto.helloworld.HelloReply = function(opt_data) { |
| 185 | jspb.Message.initialize(this, opt_data, 0, -1, null, null); |
| 186 | }; |
| 187 | goog.inherits(proto.helloworld.HelloReply, jspb.Message); |
| 188 | if (goog.DEBUG && !COMPILED) { |
| 189 | proto.helloworld.HelloReply.displayName = 'proto.helloworld.HelloReply'; |
| 190 | } |
| 191 | |
| 192 | |
| 193 | if (jspb.Message.GENERATE_TO_OBJECT) { |
| 194 | /** |
| 195 | * Creates an object representation of this proto suitable for use in Soy templates. |
| 196 | * Field names that are reserved in JavaScript and will be renamed to pb_name. |
| 197 | * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. |
| 198 | * For the list of reserved names please see: |
| 199 | * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. |
| 200 | * @param {boolean=} opt_includeInstance Whether to include the JSPB instance |
| 201 | * for transitional soy proto support: http://goto/soy-param-migration |
| 202 | * @return {!Object} |
| 203 | */ |
| 204 | proto.helloworld.HelloReply.prototype.toObject = function(opt_includeInstance) { |
| 205 | return proto.helloworld.HelloReply.toObject(opt_includeInstance, this); |
| 206 | }; |
| 207 | |
| 208 | |
| 209 | /** |
| 210 | * Static version of the {@see toObject} method. |
| 211 | * @param {boolean|undefined} includeInstance Whether to include the JSPB |
| 212 | * instance for transitional soy proto support: |
| 213 | * http://goto/soy-param-migration |
| 214 | * @param {!proto.helloworld.HelloReply} msg The msg instance to transform. |
| 215 | * @return {!Object} |
| 216 | */ |
| 217 | proto.helloworld.HelloReply.toObject = function(includeInstance, msg) { |
| 218 | var f, obj = { |
| 219 | message: msg.getMessage() |
| 220 | }; |
| 221 | |
| 222 | if (includeInstance) { |
| 223 | obj.$jspbMessageInstance = msg |
| 224 | } |
| 225 | return obj; |
| 226 | }; |
| 227 | } |
| 228 | |
| 229 | |
| 230 | /** |
| 231 | * Deserializes binary data (in protobuf wire format). |
| 232 | * @param {jspb.ByteSource} bytes The bytes to deserialize. |
| 233 | * @return {!proto.helloworld.HelloReply} |
| 234 | */ |
| 235 | proto.helloworld.HelloReply.deserializeBinary = function(bytes) { |
| 236 | var reader = new jspb.BinaryReader(bytes); |
| 237 | var msg = new proto.helloworld.HelloReply; |
| 238 | return proto.helloworld.HelloReply.deserializeBinaryFromReader(msg, reader); |
| 239 | }; |
| 240 | |
| 241 | |
| 242 | /** |
| 243 | * Deserializes binary data (in protobuf wire format) from the |
| 244 | * given reader into the given message object. |
| 245 | * @param {!proto.helloworld.HelloReply} msg The message object to deserialize into. |
| 246 | * @param {!jspb.BinaryReader} reader The BinaryReader to use. |
| 247 | * @return {!proto.helloworld.HelloReply} |
| 248 | */ |
| 249 | proto.helloworld.HelloReply.deserializeBinaryFromReader = function(msg, reader) { |
| 250 | while (reader.nextField()) { |
| 251 | if (reader.isEndGroup()) { |
| 252 | break; |
| 253 | } |
| 254 | var field = reader.getFieldNumber(); |
| 255 | switch (field) { |
| 256 | case 1: |
| 257 | var value = /** @type {string} */ (reader.readString()); |
| 258 | msg.setMessage(value); |
| 259 | break; |
| 260 | default: |
| 261 | reader.skipField(); |
| 262 | break; |
| 263 | } |
| 264 | } |
| 265 | return msg; |
| 266 | }; |
| 267 | |
| 268 | |
| 269 | /** |
| 270 | * Class method variant: serializes the given message to binary data |
| 271 | * (in protobuf wire format), writing to the given BinaryWriter. |
| 272 | * @param {!proto.helloworld.HelloReply} message |
| 273 | * @param {!jspb.BinaryWriter} writer |
| 274 | */ |
| 275 | proto.helloworld.HelloReply.serializeBinaryToWriter = function(message, writer) { |
| 276 | message.serializeBinaryToWriter(writer); |
| 277 | }; |
| 278 | |
| 279 | |
| 280 | /** |
| 281 | * Serializes the message to binary data (in protobuf wire format). |
| 282 | * @return {!Uint8Array} |
| 283 | */ |
| 284 | proto.helloworld.HelloReply.prototype.serializeBinary = function() { |
| 285 | var writer = new jspb.BinaryWriter(); |
| 286 | this.serializeBinaryToWriter(writer); |
| 287 | return writer.getResultBuffer(); |
| 288 | }; |
| 289 | |
| 290 | |
| 291 | /** |
| 292 | * Serializes the message to binary data (in protobuf wire format), |
| 293 | * writing to the given BinaryWriter. |
| 294 | * @param {!jspb.BinaryWriter} writer |
| 295 | */ |
| 296 | proto.helloworld.HelloReply.prototype.serializeBinaryToWriter = function (writer) { |
| 297 | var f = undefined; |
| 298 | f = this.getMessage(); |
| 299 | if (f.length > 0) { |
| 300 | writer.writeString( |
| 301 | 1, |
| 302 | f |
| 303 | ); |
| 304 | } |
| 305 | }; |
| 306 | |
| 307 | |
| 308 | /** |
| 309 | * Creates a deep clone of this proto. No data is shared with the original. |
| 310 | * @return {!proto.helloworld.HelloReply} The clone. |
| 311 | */ |
| 312 | proto.helloworld.HelloReply.prototype.cloneMessage = function() { |
| 313 | return /** @type {!proto.helloworld.HelloReply} */ (jspb.Message.cloneMessage(this)); |
| 314 | }; |
| 315 | |
| 316 | |
| 317 | /** |
| 318 | * optional string message = 1; |
| 319 | * @return {string} |
| 320 | */ |
| 321 | proto.helloworld.HelloReply.prototype.getMessage = function() { |
| 322 | return /** @type {string} */ (jspb.Message.getFieldProto3(this, 1, "")); |
| 323 | }; |
| 324 | |
| 325 | |
| 326 | /** @param {string} value */ |
| 327 | proto.helloworld.HelloReply.prototype.setMessage = function(value) { |
| 328 | jspb.Message.setField(this, 1, value); |
| 329 | }; |
| 330 | |
| 331 | |
| 332 | goog.object.extend(exports, proto.helloworld); |