Source: proto/spine/time_options_pb.js

  1. // source: spine/time_options.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_descriptor_pb = require('../google/protobuf/descriptor_pb.js');
  16. goog.object.extend(proto, google_protobuf_descriptor_pb);
  17. goog.exportSymbol('proto.Time', null, global);
  18. goog.exportSymbol('proto.TimeOption', null, global);
  19. goog.exportSymbol('proto.when', null, global);
  20. /**
  21. * Generated by JsPbCodeGenerator.
  22. * @param {Array=} opt_data Optional initial data array, typically from a
  23. * server response, or constructed directly in Javascript. The array is used
  24. * in place and becomes part of the constructed object. It is not cloned.
  25. * If no data is provided, the constructed object will be empty, but still
  26. * valid.
  27. * @extends {jspb.Message}
  28. * @constructor
  29. */
  30. proto.TimeOption = function(opt_data) {
  31. jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  32. };
  33. goog.inherits(proto.TimeOption, jspb.Message);
  34. if (goog.DEBUG && !COMPILED) {
  35. /**
  36. * @public
  37. * @override
  38. */
  39. proto.TimeOption.displayName = 'proto.TimeOption';
  40. }
  41. if (jspb.Message.GENERATE_TO_OBJECT) {
  42. /**
  43. * Creates an object representation of this proto.
  44. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  45. * Optional fields that are not set will be set to undefined.
  46. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  47. * For the list of reserved names please see:
  48. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  49. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  50. * JSPB instance for transitional soy proto support:
  51. * http://goto/soy-param-migration
  52. * @return {!Object}
  53. */
  54. proto.TimeOption.prototype.toObject = function(opt_includeInstance) {
  55. return proto.TimeOption.toObject(opt_includeInstance, this);
  56. };
  57. /**
  58. * Static version of the {@see toObject} method.
  59. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  60. * the JSPB instance for transitional soy proto support:
  61. * http://goto/soy-param-migration
  62. * @param {!proto.TimeOption} msg The msg instance to transform.
  63. * @return {!Object}
  64. * @suppress {unusedLocalVariables} f is only used for nested messages
  65. */
  66. proto.TimeOption.toObject = function(includeInstance, msg) {
  67. var f, obj = {
  68. pb_in: jspb.Message.getFieldWithDefault(msg, 1, 0),
  69. msgFormat: jspb.Message.getFieldWithDefault(msg, 2, "")
  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.TimeOption}
  81. */
  82. proto.TimeOption.deserializeBinary = function(bytes) {
  83. var reader = new jspb.BinaryReader(bytes);
  84. var msg = new proto.TimeOption;
  85. return proto.TimeOption.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.TimeOption} msg The message object to deserialize into.
  91. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  92. * @return {!proto.TimeOption}
  93. */
  94. proto.TimeOption.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 = /** @type {!proto.Time} */ (reader.readEnum());
  103. msg.setIn(value);
  104. break;
  105. case 2:
  106. var value = /** @type {string} */ (reader.readString());
  107. msg.setMsgFormat(value);
  108. break;
  109. default:
  110. reader.skipField();
  111. break;
  112. }
  113. }
  114. return msg;
  115. };
  116. /**
  117. * Serializes the message to binary data (in protobuf wire format).
  118. * @return {!Uint8Array}
  119. */
  120. proto.TimeOption.prototype.serializeBinary = function() {
  121. var writer = new jspb.BinaryWriter();
  122. proto.TimeOption.serializeBinaryToWriter(this, writer);
  123. return writer.getResultBuffer();
  124. };
  125. /**
  126. * Serializes the given message to binary data (in protobuf wire
  127. * format), writing to the given BinaryWriter.
  128. * @param {!proto.TimeOption} message
  129. * @param {!jspb.BinaryWriter} writer
  130. * @suppress {unusedLocalVariables} f is only used for nested messages
  131. */
  132. proto.TimeOption.serializeBinaryToWriter = function(message, writer) {
  133. var f = undefined;
  134. f = message.getIn();
  135. if (f !== 0.0) {
  136. writer.writeEnum(
  137. 1,
  138. f
  139. );
  140. }
  141. f = message.getMsgFormat();
  142. if (f.length > 0) {
  143. writer.writeString(
  144. 2,
  145. f
  146. );
  147. }
  148. };
  149. /**
  150. * optional Time in = 1;
  151. * @return {!proto.Time}
  152. */
  153. proto.TimeOption.prototype.getIn = function() {
  154. return /** @type {!proto.Time} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
  155. };
  156. /**
  157. * @param {!proto.Time} value
  158. * @return {!proto.TimeOption} returns this
  159. */
  160. proto.TimeOption.prototype.setIn = function(value) {
  161. return jspb.Message.setProto3EnumField(this, 1, value);
  162. };
  163. /**
  164. * optional string msg_format = 2;
  165. * @return {string}
  166. */
  167. proto.TimeOption.prototype.getMsgFormat = function() {
  168. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
  169. };
  170. /**
  171. * @param {string} value
  172. * @return {!proto.TimeOption} returns this
  173. */
  174. proto.TimeOption.prototype.setMsgFormat = function(value) {
  175. return jspb.Message.setProto3StringField(this, 2, value);
  176. };
  177. /**
  178. * @enum {number}
  179. */
  180. proto.Time = {
  181. TIME_UNDEFINED: 0,
  182. PAST: 1,
  183. FUTURE: 2
  184. };
  185. /**
  186. * A tuple of {field number, class constructor} for the extension
  187. * field named `when`.
  188. * @type {!jspb.ExtensionFieldInfo<!proto.TimeOption>}
  189. */
  190. proto.when = new jspb.ExtensionFieldInfo(
  191. 73819,
  192. {when: 0},
  193. proto.TimeOption,
  194. /** @type {?function((boolean|undefined),!jspb.Message=): !Object} */ (
  195. proto.TimeOption.toObject),
  196. 0);
  197. google_protobuf_descriptor_pb.FieldOptions.extensionsBinary[73819] = new jspb.ExtensionFieldBinaryInfo(
  198. proto.when,
  199. jspb.BinaryReader.prototype.readMessage,
  200. jspb.BinaryWriter.prototype.writeMessage,
  201. proto.TimeOption.serializeBinaryToWriter,
  202. proto.TimeOption.deserializeBinaryFromReader,
  203. false);
  204. // This registers the extension field with the extended class, so that
  205. // toObject() will function correctly.
  206. google_protobuf_descriptor_pb.FieldOptions.extensions[73819] = proto.when;
  207. goog.object.extend(exports, proto);
  208. // Generated by Spine ProtoJs Plugin
  209. let ObjectParser = require('../../client/parser/object-parser.js').default;
  210. let TypeParsers = require('../../client/parser/type-parsers.js').default;
  211. proto.TimeOption.Parser = function() {
  212. ObjectParser.call(this);
  213. };
  214. proto.TimeOption.Parser.prototype = Object.create(ObjectParser.prototype);
  215. proto.TimeOption.Parser.prototype.constructor = proto.TimeOption.Parser;
  216. proto.TimeOption.Parser.prototype.fromObject = function(obj) {
  217. if (obj === null) {
  218. return null;
  219. }
  220. let msg = new proto.TimeOption();
  221. if (obj.in !== undefined) {
  222. if (obj.in !== null) {
  223. let value = proto.Time[obj.in];
  224. msg.setIn(value);
  225. }
  226. }
  227. if (obj.msgFormat !== undefined) {
  228. if (obj.msgFormat !== null) {
  229. let value = obj.msgFormat;
  230. msg.setMsgFormat(value);
  231. }
  232. }
  233. return msg;
  234. };
  235. // Generated by Spine ProtoJs Plugin
  236. proto.TimeOption.typeUrl = function() {
  237. return 'type.spine.io/TimeOption';
  238. };
  239. // Generated by Spine ProtoJs Plugin
  240. proto.Time.typeUrl = function() {
  241. return 'type.spine.io/Time';
  242. };