Source: proto/spine/change/value_mismatch_pb.js

  1. // source: spine/change/value_mismatch.proto
  2. /**
  3. * @fileoverview
  4. * @enhanceable
  5. * @suppress {messageConventions} JS Compiler reports an error if a variable or
  6. * field starts with 'MSG_' and isn't a translatable message.
  7. * @public
  8. */
  9. // GENERATED CODE -- DO NOT EDIT!
  10. var jspb = require('google-protobuf');
  11. var goog = jspb;
  12. var global = Function('return this')();
  13. var spine_options_pb = require('../../spine/options_pb.js');
  14. goog.object.extend(proto, spine_options_pb);
  15. var google_protobuf_any_pb = require('../../google/protobuf/any_pb.js');
  16. goog.object.extend(proto, google_protobuf_any_pb);
  17. goog.exportSymbol('proto.spine.change.ValueMismatch', null, global);
  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.spine.change.ValueMismatch = function(opt_data) {
  29. jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  30. };
  31. goog.inherits(proto.spine.change.ValueMismatch, jspb.Message);
  32. if (goog.DEBUG && !COMPILED) {
  33. /**
  34. * @public
  35. * @override
  36. */
  37. proto.spine.change.ValueMismatch.displayName = 'proto.spine.change.ValueMismatch';
  38. }
  39. if (jspb.Message.GENERATE_TO_OBJECT) {
  40. /**
  41. * Creates an object representation of this proto.
  42. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  43. * Optional fields that are not set will be set to undefined.
  44. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  45. * For the list of reserved names please see:
  46. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  47. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  48. * JSPB instance for transitional soy proto support:
  49. * http://goto/soy-param-migration
  50. * @return {!Object}
  51. */
  52. proto.spine.change.ValueMismatch.prototype.toObject = function(opt_includeInstance) {
  53. return proto.spine.change.ValueMismatch.toObject(opt_includeInstance, this);
  54. };
  55. /**
  56. * Static version of the {@see toObject} method.
  57. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  58. * the JSPB instance for transitional soy proto support:
  59. * http://goto/soy-param-migration
  60. * @param {!proto.spine.change.ValueMismatch} msg The msg instance to transform.
  61. * @return {!Object}
  62. * @suppress {unusedLocalVariables} f is only used for nested messages
  63. */
  64. proto.spine.change.ValueMismatch.toObject = function(includeInstance, msg) {
  65. var f, obj = {
  66. expected: (f = msg.getExpected()) && google_protobuf_any_pb.Any.toObject(includeInstance, f),
  67. actual: (f = msg.getActual()) && google_protobuf_any_pb.Any.toObject(includeInstance, f),
  68. newValue: (f = msg.getNewValue()) && google_protobuf_any_pb.Any.toObject(includeInstance, f),
  69. version: jspb.Message.getFieldWithDefault(msg, 4, 0)
  70. };
  71. if (includeInstance) {
  72. obj.$jspbMessageInstance = msg;
  73. }
  74. return obj;
  75. };
  76. }
  77. /**
  78. * Deserializes binary data (in protobuf wire format).
  79. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  80. * @return {!proto.spine.change.ValueMismatch}
  81. */
  82. proto.spine.change.ValueMismatch.deserializeBinary = function(bytes) {
  83. var reader = new jspb.BinaryReader(bytes);
  84. var msg = new proto.spine.change.ValueMismatch;
  85. return proto.spine.change.ValueMismatch.deserializeBinaryFromReader(msg, reader);
  86. };
  87. /**
  88. * Deserializes binary data (in protobuf wire format) from the
  89. * given reader into the given message object.
  90. * @param {!proto.spine.change.ValueMismatch} msg The message object to deserialize into.
  91. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  92. * @return {!proto.spine.change.ValueMismatch}
  93. */
  94. proto.spine.change.ValueMismatch.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 = new google_protobuf_any_pb.Any;
  103. reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
  104. msg.setExpected(value);
  105. break;
  106. case 2:
  107. var value = new google_protobuf_any_pb.Any;
  108. reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
  109. msg.setActual(value);
  110. break;
  111. case 3:
  112. var value = new google_protobuf_any_pb.Any;
  113. reader.readMessage(value,google_protobuf_any_pb.Any.deserializeBinaryFromReader);
  114. msg.setNewValue(value);
  115. break;
  116. case 4:
  117. var value = /** @type {number} */ (reader.readInt32());
  118. msg.setVersion(value);
  119. break;
  120. default:
  121. reader.skipField();
  122. break;
  123. }
  124. }
  125. return msg;
  126. };
  127. /**
  128. * Serializes the message to binary data (in protobuf wire format).
  129. * @return {!Uint8Array}
  130. */
  131. proto.spine.change.ValueMismatch.prototype.serializeBinary = function() {
  132. var writer = new jspb.BinaryWriter();
  133. proto.spine.change.ValueMismatch.serializeBinaryToWriter(this, writer);
  134. return writer.getResultBuffer();
  135. };
  136. /**
  137. * Serializes the given message to binary data (in protobuf wire
  138. * format), writing to the given BinaryWriter.
  139. * @param {!proto.spine.change.ValueMismatch} message
  140. * @param {!jspb.BinaryWriter} writer
  141. * @suppress {unusedLocalVariables} f is only used for nested messages
  142. */
  143. proto.spine.change.ValueMismatch.serializeBinaryToWriter = function(message, writer) {
  144. var f = undefined;
  145. f = message.getExpected();
  146. if (f != null) {
  147. writer.writeMessage(
  148. 1,
  149. f,
  150. google_protobuf_any_pb.Any.serializeBinaryToWriter
  151. );
  152. }
  153. f = message.getActual();
  154. if (f != null) {
  155. writer.writeMessage(
  156. 2,
  157. f,
  158. google_protobuf_any_pb.Any.serializeBinaryToWriter
  159. );
  160. }
  161. f = message.getNewValue();
  162. if (f != null) {
  163. writer.writeMessage(
  164. 3,
  165. f,
  166. google_protobuf_any_pb.Any.serializeBinaryToWriter
  167. );
  168. }
  169. f = message.getVersion();
  170. if (f !== 0) {
  171. writer.writeInt32(
  172. 4,
  173. f
  174. );
  175. }
  176. };
  177. /**
  178. * optional google.protobuf.Any expected = 1;
  179. * @return {?proto.google.protobuf.Any}
  180. */
  181. proto.spine.change.ValueMismatch.prototype.getExpected = function() {
  182. return /** @type{?proto.google.protobuf.Any} */ (
  183. jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 1));
  184. };
  185. /**
  186. * @param {?proto.google.protobuf.Any|undefined} value
  187. * @return {!proto.spine.change.ValueMismatch} returns this
  188. */
  189. proto.spine.change.ValueMismatch.prototype.setExpected = function(value) {
  190. return jspb.Message.setWrapperField(this, 1, value);
  191. };
  192. /**
  193. * Clears the message field making it undefined.
  194. * @return {!proto.spine.change.ValueMismatch} returns this
  195. */
  196. proto.spine.change.ValueMismatch.prototype.clearExpected = function() {
  197. return this.setExpected(undefined);
  198. };
  199. /**
  200. * Returns whether this field is set.
  201. * @return {boolean}
  202. */
  203. proto.spine.change.ValueMismatch.prototype.hasExpected = function() {
  204. return jspb.Message.getField(this, 1) != null;
  205. };
  206. /**
  207. * optional google.protobuf.Any actual = 2;
  208. * @return {?proto.google.protobuf.Any}
  209. */
  210. proto.spine.change.ValueMismatch.prototype.getActual = function() {
  211. return /** @type{?proto.google.protobuf.Any} */ (
  212. jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 2));
  213. };
  214. /**
  215. * @param {?proto.google.protobuf.Any|undefined} value
  216. * @return {!proto.spine.change.ValueMismatch} returns this
  217. */
  218. proto.spine.change.ValueMismatch.prototype.setActual = function(value) {
  219. return jspb.Message.setWrapperField(this, 2, value);
  220. };
  221. /**
  222. * Clears the message field making it undefined.
  223. * @return {!proto.spine.change.ValueMismatch} returns this
  224. */
  225. proto.spine.change.ValueMismatch.prototype.clearActual = function() {
  226. return this.setActual(undefined);
  227. };
  228. /**
  229. * Returns whether this field is set.
  230. * @return {boolean}
  231. */
  232. proto.spine.change.ValueMismatch.prototype.hasActual = function() {
  233. return jspb.Message.getField(this, 2) != null;
  234. };
  235. /**
  236. * optional google.protobuf.Any new_value = 3;
  237. * @return {?proto.google.protobuf.Any}
  238. */
  239. proto.spine.change.ValueMismatch.prototype.getNewValue = function() {
  240. return /** @type{?proto.google.protobuf.Any} */ (
  241. jspb.Message.getWrapperField(this, google_protobuf_any_pb.Any, 3));
  242. };
  243. /**
  244. * @param {?proto.google.protobuf.Any|undefined} value
  245. * @return {!proto.spine.change.ValueMismatch} returns this
  246. */
  247. proto.spine.change.ValueMismatch.prototype.setNewValue = function(value) {
  248. return jspb.Message.setWrapperField(this, 3, value);
  249. };
  250. /**
  251. * Clears the message field making it undefined.
  252. * @return {!proto.spine.change.ValueMismatch} returns this
  253. */
  254. proto.spine.change.ValueMismatch.prototype.clearNewValue = function() {
  255. return this.setNewValue(undefined);
  256. };
  257. /**
  258. * Returns whether this field is set.
  259. * @return {boolean}
  260. */
  261. proto.spine.change.ValueMismatch.prototype.hasNewValue = function() {
  262. return jspb.Message.getField(this, 3) != null;
  263. };
  264. /**
  265. * optional int32 version = 4;
  266. * @return {number}
  267. */
  268. proto.spine.change.ValueMismatch.prototype.getVersion = function() {
  269. return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0));
  270. };
  271. /**
  272. * @param {number} value
  273. * @return {!proto.spine.change.ValueMismatch} returns this
  274. */
  275. proto.spine.change.ValueMismatch.prototype.setVersion = function(value) {
  276. return jspb.Message.setProto3IntField(this, 4, value);
  277. };
  278. goog.object.extend(exports, proto.spine.change);
  279. // Generated by Spine ProtoJs Plugin
  280. let ObjectParser = require('../../../client/parser/object-parser.js').default;
  281. let TypeParsers = require('../../../client/parser/type-parsers.js').default;
  282. proto.spine.change.ValueMismatch.Parser = function() {
  283. ObjectParser.call(this);
  284. };
  285. proto.spine.change.ValueMismatch.Parser.prototype = Object.create(ObjectParser.prototype);
  286. proto.spine.change.ValueMismatch.Parser.prototype.constructor = proto.spine.change.ValueMismatch.Parser;
  287. proto.spine.change.ValueMismatch.Parser.prototype.fromObject = function(obj) {
  288. if (obj === null) {
  289. return null;
  290. }
  291. let msg = new proto.spine.change.ValueMismatch();
  292. if (obj.expected !== undefined) {
  293. if (obj.expected === null) {
  294. msg.setExpected(null);
  295. } else {
  296. let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.expected);
  297. msg.setExpected(value);
  298. }
  299. }
  300. if (obj.actual !== undefined) {
  301. if (obj.actual === null) {
  302. msg.setActual(null);
  303. } else {
  304. let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.actual);
  305. msg.setActual(value);
  306. }
  307. }
  308. if (obj.newValue !== undefined) {
  309. if (obj.newValue === null) {
  310. msg.setNewValue(null);
  311. } else {
  312. let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Any').fromObject(obj.newValue);
  313. msg.setNewValue(value);
  314. }
  315. }
  316. if (obj.version !== undefined) {
  317. if (obj.version !== null) {
  318. let value = obj.version;
  319. msg.setVersion(value);
  320. }
  321. }
  322. return msg;
  323. };
  324. // Generated by Spine ProtoJs Plugin
  325. proto.spine.change.ValueMismatch.typeUrl = function() {
  326. return 'type.spine.io/spine.change.ValueMismatch';
  327. };