UNPKG

@x5e/gink

Version:

an eventually consistent database

198 lines 6.84 kB
// source: proto/pair.proto /** * @fileoverview * @enhanceable * @suppress {messageConventions} JS Compiler reports an error if a variable or * field starts with 'MSG_' and isn't a translatable message. * @public */ // GENERATED CODE -- DO NOT EDIT! var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); var proto_muid_pb = require('../proto/muid_pb.js'); goog.object.extend(proto, proto_muid_pb); goog.exportSymbol('proto.gink.Pair', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.gink.Pair = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.gink.Pair, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.gink.Pair.displayName = 'proto.gink.Pair'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.gink.Pair.prototype.toObject = function (opt_includeInstance) { return proto.gink.Pair.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.gink.Pair} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.gink.Pair.toObject = function (includeInstance, msg) { var f, obj = { left: (f = msg.getLeft()) && proto_muid_pb.Muid.toObject(includeInstance, f), rite: (f = msg.getRite()) && proto_muid_pb.Muid.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.gink.Pair} */ proto.gink.Pair.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.gink.Pair; return proto.gink.Pair.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.gink.Pair} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.gink.Pair} */ proto.gink.Pair.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto_muid_pb.Muid; reader.readMessage(value, proto_muid_pb.Muid.deserializeBinaryFromReader); msg.setLeft(value); break; case 2: var value = new proto_muid_pb.Muid; reader.readMessage(value, proto_muid_pb.Muid.deserializeBinaryFromReader); msg.setRite(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.gink.Pair.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.gink.Pair.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.gink.Pair} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.gink.Pair.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getLeft(); if (f != null) { writer.writeMessage(1, f, proto_muid_pb.Muid.serializeBinaryToWriter); } f = message.getRite(); if (f != null) { writer.writeMessage(2, f, proto_muid_pb.Muid.serializeBinaryToWriter); } }; /** * optional Muid left = 1; * @return {?proto.gink.Muid} */ proto.gink.Pair.prototype.getLeft = function () { return /** @type{?proto.gink.Muid} */ (jspb.Message.getWrapperField(this, proto_muid_pb.Muid, 1)); }; /** * @param {?proto.gink.Muid|undefined} value * @return {!proto.gink.Pair} returns this */ proto.gink.Pair.prototype.setLeft = function (value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.gink.Pair} returns this */ proto.gink.Pair.prototype.clearLeft = function () { return this.setLeft(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.gink.Pair.prototype.hasLeft = function () { return jspb.Message.getField(this, 1) != null; }; /** * optional Muid rite = 2; * @return {?proto.gink.Muid} */ proto.gink.Pair.prototype.getRite = function () { return /** @type{?proto.gink.Muid} */ (jspb.Message.getWrapperField(this, proto_muid_pb.Muid, 2)); }; /** * @param {?proto.gink.Muid|undefined} value * @return {!proto.gink.Pair} returns this */ proto.gink.Pair.prototype.setRite = function (value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.gink.Pair} returns this */ proto.gink.Pair.prototype.clearRite = function () { return this.setRite(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.gink.Pair.prototype.hasRite = function () { return jspb.Message.getField(this, 2) != null; }; goog.object.extend(exports, proto.gink); //# sourceMappingURL=pair_pb.js.map