// source: spine/change/value_mismatch.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 spine_options_pb = require('../../spine/options_pb.js');
goog.object.extend(proto, spine_options_pb);
var google_protobuf_any_pb = require('../../google/protobuf/any_pb.js');
goog.object.extend(proto, google_protobuf_any_pb);
goog.exportSymbol('proto.spine.change.ValueMismatch', 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.spine.change.ValueMismatch = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.spine.change.ValueMismatch, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.spine.change.ValueMismatch.displayName = 'proto.spine.change.ValueMismatch';
}
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.spine.change.ValueMismatch.prototype.toObject = function(opt_includeInstance) {
return proto.spine.change.ValueMismatch.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.spine.change.ValueMismatch} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.change.ValueMismatch.toObject = function(includeInstance, msg) {
var f, obj = {
expected: (f = msg.getExpected()) && google_protobuf_any_pb.Any.toObject(includeInstance, f),
actual: (f = msg.getActual()) && google_protobuf_any_pb.Any.toObject(includeInstance, f),
newValue: (f = msg.getNewValue()) && google_protobuf_any_pb.Any.toObject(includeInstance, f),
version: jspb.Message.getFieldWithDefault(msg, 4, 0)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.spine.change.ValueMismatch}
*/
proto.spine.change.ValueMismatch.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.spine.change.ValueMismatch;
return proto.spine.change.ValueMismatch.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.spine.change.ValueMismatch} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.spine.change.ValueMismatch}
*/
proto.spine.change.ValueMismatch.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new google_protobuf_any_pb.Any;
reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
msg.setExpected(value);
break;
case 2:
var value = new google_protobuf_any_pb.Any;
reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
msg.setActual(value);
break;
case 3:
var value = new google_protobuf_any_pb.Any;
reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
msg.setNewValue(value);
break;
case 4:
var value = /** @type {number} */ (reader.readInt32());
msg.setVersion(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.spine.change.ValueMismatch.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.spine.change.ValueMismatch.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.spine.change.ValueMismatch} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.spine.change.ValueMismatch.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getExpected();
if (f != null) {
writer.writeMessage(
1,
f,
google_protobuf_any_pb.Any.serializeBinaryToWriter
);
}
f = message.getActual();
if (f != null) {
writer.writeMessage(
2,
f,
google_protobuf_any_pb.Any.serializeBinaryToWriter
);
}
f = message.getNewValue();
if (f != null) {
writer.writeMessage(
3,
f,
google_protobuf_any_pb.Any.serializeBinaryToWriter
);
}
f = message.getVersion();
if (f !== 0) {
writer.writeInt32(
4,
f
);
}
};
/**
* optional google.protobuf.Any expected = 1;
* @return {?proto.google.protobuf.Any}
*/
proto.spine.change.ValueMismatch.prototype.getExpected = function() {
return /** @type{?proto.google.protobuf.Any} */ (
jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 1));
};
/**
* @param {?proto.google.protobuf.Any|undefined} value
* @return {!proto.spine.change.ValueMismatch} returns this
*/
proto.spine.change.ValueMismatch.prototype.setExpected = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.change.ValueMismatch} returns this
*/
proto.spine.change.ValueMismatch.prototype.clearExpected = function() {
return this.setExpected(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.change.ValueMismatch.prototype.hasExpected = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional google.protobuf.Any actual = 2;
* @return {?proto.google.protobuf.Any}
*/
proto.spine.change.ValueMismatch.prototype.getActual = function() {
return /** @type{?proto.google.protobuf.Any} */ (
jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 2));
};
/**
* @param {?proto.google.protobuf.Any|undefined} value
* @return {!proto.spine.change.ValueMismatch} returns this
*/
proto.spine.change.ValueMismatch.prototype.setActual = function(value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.change.ValueMismatch} returns this
*/
proto.spine.change.ValueMismatch.prototype.clearActual = function() {
return this.setActual(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.change.ValueMismatch.prototype.hasActual = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional google.protobuf.Any new_value = 3;
* @return {?proto.google.protobuf.Any}
*/
proto.spine.change.ValueMismatch.prototype.getNewValue = function() {
return /** @type{?proto.google.protobuf.Any} */ (
jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 3));
};
/**
* @param {?proto.google.protobuf.Any|undefined} value
* @return {!proto.spine.change.ValueMismatch} returns this
*/
proto.spine.change.ValueMismatch.prototype.setNewValue = function(value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.spine.change.ValueMismatch} returns this
*/
proto.spine.change.ValueMismatch.prototype.clearNewValue = function() {
return this.setNewValue(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.spine.change.ValueMismatch.prototype.hasNewValue = function() {
return jspb.Message.getField(this, 3) != null;
};
/**
* optional int32 version = 4;
* @return {number}
*/
proto.spine.change.ValueMismatch.prototype.getVersion = function() {
return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
};
/**
* @param {number} value
* @return {!proto.spine.change.ValueMismatch} returns this
*/
proto.spine.change.ValueMismatch.prototype.setVersion = function(value) {
return jspb.Message.setProto3IntField(this, 4, value);
};
goog.object.extend(exports, proto.spine.change);
// Generated by Spine ProtoJs Plugin
let ObjectParser = require('../../../client/parser/object-parser.js').default;
let TypeParsers = require('../../../client/parser/type-parsers.js').default;
proto.spine.change.ValueMismatch.Parser = function() {
ObjectParser.call(this);
};
proto.spine.change.ValueMismatch.Parser.prototype = Object.create(ObjectParser.prototype);
proto.spine.change.ValueMismatch.Parser.prototype.constructor = proto.spine.change.ValueMismatch.Parser;
proto.spine.change.ValueMismatch.Parser.prototype.fromObject = function(obj) {
if (obj === null) {
return null;
}
let msg = new proto.spine.change.ValueMismatch();
if (obj.expected !== undefined) {
if (obj.expected === null) {
msg.setExpected(null);
} else {
let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.expected);
msg.setExpected(value);
}
}
if (obj.actual !== undefined) {
if (obj.actual === null) {
msg.setActual(null);
} else {
let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.actual);
msg.setActual(value);
}
}
if (obj.newValue !== undefined) {
if (obj.newValue === null) {
msg.setNewValue(null);
} else {
let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.newValue);
msg.setNewValue(value);
}
}
if (obj.version !== undefined) {
if (obj.version !== null) {
let value = obj.version;
msg.setVersion(value);
}
}
return msg;
};
// Generated by Spine ProtoJs Plugin
proto.spine.change.ValueMismatch.typeUrl = function() {
return 'type.spine.io/spine.change.ValueMismatch';
};