Source: proto/spine/core/version_pb.js

  1. // source: spine/core/version.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_timestamp_pb = require('../../google/protobuf/timestamp_pb.js');
  16. goog.object.extend(proto, google_protobuf_timestamp_pb);
  17. goog.exportSymbol('proto.spine.core.Version', 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.core.Version = function(opt_data) {
  29. jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  30. };
  31. goog.inherits(proto.spine.core.Version, jspb.Message);
  32. if (goog.DEBUG && !COMPILED) {
  33. /**
  34. * @public
  35. * @override
  36. */
  37. proto.spine.core.Version.displayName = 'proto.spine.core.Version';
  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.core.Version.prototype.toObject = function(opt_includeInstance) {
  53. return proto.spine.core.Version.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.core.Version} msg The msg instance to transform.
  61. * @return {!Object}
  62. * @suppress {unusedLocalVariables} f is only used for nested messages
  63. */
  64. proto.spine.core.Version.toObject = function(includeInstance, msg) {
  65. var f, obj = {
  66. number: jspb.Message.getFieldWithDefault(msg, 1, 0),
  67. timestamp: (f = msg.getTimestamp()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f)
  68. };
  69. if (includeInstance) {
  70. obj.$jspbMessageInstance = msg;
  71. }
  72. return obj;
  73. };
  74. }
  75. /**
  76. * Deserializes binary data (in protobuf wire format).
  77. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  78. * @return {!proto.spine.core.Version}
  79. */
  80. proto.spine.core.Version.deserializeBinary = function(bytes) {
  81. var reader = new jspb.BinaryReader(bytes);
  82. var msg = new proto.spine.core.Version;
  83. return proto.spine.core.Version.deserializeBinaryFromReader(msg, reader);
  84. };
  85. /**
  86. * Deserializes binary data (in protobuf wire format) from the
  87. * given reader into the given message object.
  88. * @param {!proto.spine.core.Version} msg The message object to deserialize into.
  89. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  90. * @return {!proto.spine.core.Version}
  91. */
  92. proto.spine.core.Version.deserializeBinaryFromReader = function(msg, reader) {
  93. while (reader.nextField()) {
  94. if (reader.isEndGroup()) {
  95. break;
  96. }
  97. var field = reader.getFieldNumber();
  98. switch (field) {
  99. case 1:
  100. var value = /** @type {number} */ (reader.readInt32());
  101. msg.setNumber(value);
  102. break;
  103. case 2:
  104. var value = new google_protobuf_timestamp_pb.Timestamp;
  105. reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader);
  106. msg.setTimestamp(value);
  107. break;
  108. default:
  109. reader.skipField();
  110. break;
  111. }
  112. }
  113. return msg;
  114. };
  115. /**
  116. * Serializes the message to binary data (in protobuf wire format).
  117. * @return {!Uint8Array}
  118. */
  119. proto.spine.core.Version.prototype.serializeBinary = function() {
  120. var writer = new jspb.BinaryWriter();
  121. proto.spine.core.Version.serializeBinaryToWriter(this, writer);
  122. return writer.getResultBuffer();
  123. };
  124. /**
  125. * Serializes the given message to binary data (in protobuf wire
  126. * format), writing to the given BinaryWriter.
  127. * @param {!proto.spine.core.Version} message
  128. * @param {!jspb.BinaryWriter} writer
  129. * @suppress {unusedLocalVariables} f is only used for nested messages
  130. */
  131. proto.spine.core.Version.serializeBinaryToWriter = function(message, writer) {
  132. var f = undefined;
  133. f = message.getNumber();
  134. if (f !== 0) {
  135. writer.writeInt32(
  136. 1,
  137. f
  138. );
  139. }
  140. f = message.getTimestamp();
  141. if (f != null) {
  142. writer.writeMessage(
  143. 2,
  144. f,
  145. google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
  146. );
  147. }
  148. };
  149. /**
  150. * optional int32 number = 1;
  151. * @return {number}
  152. */
  153. proto.spine.core.Version.prototype.getNumber = function() {
  154. return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
  155. };
  156. /**
  157. * @param {number} value
  158. * @return {!proto.spine.core.Version} returns this
  159. */
  160. proto.spine.core.Version.prototype.setNumber = function(value) {
  161. return jspb.Message.setProto3IntField(this, 1, value);
  162. };
  163. /**
  164. * optional google.protobuf.Timestamp timestamp = 2;
  165. * @return {?proto.google.protobuf.Timestamp}
  166. */
  167. proto.spine.core.Version.prototype.getTimestamp = function() {
  168. return /** @type{?proto.google.protobuf.Timestamp} */ (
  169. jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2));
  170. };
  171. /**
  172. * @param {?proto.google.protobuf.Timestamp|undefined} value
  173. * @return {!proto.spine.core.Version} returns this
  174. */
  175. proto.spine.core.Version.prototype.setTimestamp = function(value) {
  176. return jspb.Message.setWrapperField(this, 2, value);
  177. };
  178. /**
  179. * Clears the message field making it undefined.
  180. * @return {!proto.spine.core.Version} returns this
  181. */
  182. proto.spine.core.Version.prototype.clearTimestamp = function() {
  183. return this.setTimestamp(undefined);
  184. };
  185. /**
  186. * Returns whether this field is set.
  187. * @return {boolean}
  188. */
  189. proto.spine.core.Version.prototype.hasTimestamp = function() {
  190. return jspb.Message.getField(this, 2) != null;
  191. };
  192. goog.object.extend(exports, proto.spine.core);
  193. // Generated by Spine ProtoJs Plugin
  194. let ObjectParser = require('../../../client/parser/object-parser.js').default;
  195. let TypeParsers = require('../../../client/parser/type-parsers.js').default;
  196. proto.spine.core.Version.Parser = function() {
  197. ObjectParser.call(this);
  198. };
  199. proto.spine.core.Version.Parser.prototype = Object.create(ObjectParser.prototype);
  200. proto.spine.core.Version.Parser.prototype.constructor = proto.spine.core.Version.Parser;
  201. proto.spine.core.Version.Parser.prototype.fromObject = function(obj) {
  202. if (obj === null) {
  203. return null;
  204. }
  205. let msg = new proto.spine.core.Version();
  206. if (obj.number !== undefined) {
  207. if (obj.number !== null) {
  208. let value = obj.number;
  209. msg.setNumber(value);
  210. }
  211. }
  212. if (obj.timestamp !== undefined) {
  213. if (obj.timestamp === null) {
  214. msg.setTimestamp(null);
  215. } else {
  216. let value = TypeParsers.parserFor('type.googleapis.com/google.protobuf.Timestamp').fromObject(obj.timestamp);
  217. msg.setTimestamp(value);
  218. }
  219. }
  220. return msg;
  221. };
  222. // Generated by Spine ProtoJs Plugin
  223. proto.spine.core.Version.typeUrl = function() {
  224. return 'type.spine.io/spine.core.Version';
  225. };