Source: proto/spine/base/field_path_pb.js

  1. // source: spine/base/field_path.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. goog.exportSymbol('proto.spine.base.FieldPath', null, global);
  16. /**
  17. * Generated by JsPbCodeGenerator.
  18. * @param {Array=} opt_data Optional initial data array, typically from a
  19. * server response, or constructed directly in Javascript. The array is used
  20. * in place and becomes part of the constructed object. It is not cloned.
  21. * If no data is provided, the constructed object will be empty, but still
  22. * valid.
  23. * @extends {jspb.Message}
  24. * @constructor
  25. */
  26. proto.spine.base.FieldPath = function(opt_data) {
  27. jspb.Message.initialize(this, opt_data, 0, -1, proto.spine.base.FieldPath.repeatedFields_, null);
  28. };
  29. goog.inherits(proto.spine.base.FieldPath, jspb.Message);
  30. if (goog.DEBUG && !COMPILED) {
  31. /**
  32. * @public
  33. * @override
  34. */
  35. proto.spine.base.FieldPath.displayName = 'proto.spine.base.FieldPath';
  36. }
  37. /**
  38. * List of repeated fields within this message type.
  39. * @private {!Array<number>}
  40. * @const
  41. */
  42. proto.spine.base.FieldPath.repeatedFields_ = [1];
  43. if (jspb.Message.GENERATE_TO_OBJECT) {
  44. /**
  45. * Creates an object representation of this proto.
  46. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  47. * Optional fields that are not set will be set to undefined.
  48. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  49. * For the list of reserved names please see:
  50. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  51. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  52. * JSPB instance for transitional soy proto support:
  53. * http://goto/soy-param-migration
  54. * @return {!Object}
  55. */
  56. proto.spine.base.FieldPath.prototype.toObject = function(opt_includeInstance) {
  57. return proto.spine.base.FieldPath.toObject(opt_includeInstance, this);
  58. };
  59. /**
  60. * Static version of the {@see toObject} method.
  61. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  62. * the JSPB instance for transitional soy proto support:
  63. * http://goto/soy-param-migration
  64. * @param {!proto.spine.base.FieldPath} msg The msg instance to transform.
  65. * @return {!Object}
  66. * @suppress {unusedLocalVariables} f is only used for nested messages
  67. */
  68. proto.spine.base.FieldPath.toObject = function(includeInstance, msg) {
  69. var f, obj = {
  70. fieldNameList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f
  71. };
  72. if (includeInstance) {
  73. obj.$jspbMessageInstance = msg;
  74. }
  75. return obj;
  76. };
  77. }
  78. /**
  79. * Deserializes binary data (in protobuf wire format).
  80. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  81. * @return {!proto.spine.base.FieldPath}
  82. */
  83. proto.spine.base.FieldPath.deserializeBinary = function(bytes) {
  84. var reader = new jspb.BinaryReader(bytes);
  85. var msg = new proto.spine.base.FieldPath;
  86. return proto.spine.base.FieldPath.deserializeBinaryFromReader(msg, reader);
  87. };
  88. /**
  89. * Deserializes binary data (in protobuf wire format) from the
  90. * given reader into the given message object.
  91. * @param {!proto.spine.base.FieldPath} msg The message object to deserialize into.
  92. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  93. * @return {!proto.spine.base.FieldPath}
  94. */
  95. proto.spine.base.FieldPath.deserializeBinaryFromReader = function(msg, reader) {
  96. while (reader.nextField()) {
  97. if (reader.isEndGroup()) {
  98. break;
  99. }
  100. var field = reader.getFieldNumber();
  101. switch (field) {
  102. case 1:
  103. var value = /** @type {string} */ (reader.readString());
  104. msg.addFieldName(value);
  105. break;
  106. default:
  107. reader.skipField();
  108. break;
  109. }
  110. }
  111. return msg;
  112. };
  113. /**
  114. * Serializes the message to binary data (in protobuf wire format).
  115. * @return {!Uint8Array}
  116. */
  117. proto.spine.base.FieldPath.prototype.serializeBinary = function() {
  118. var writer = new jspb.BinaryWriter();
  119. proto.spine.base.FieldPath.serializeBinaryToWriter(this, writer);
  120. return writer.getResultBuffer();
  121. };
  122. /**
  123. * Serializes the given message to binary data (in protobuf wire
  124. * format), writing to the given BinaryWriter.
  125. * @param {!proto.spine.base.FieldPath} message
  126. * @param {!jspb.BinaryWriter} writer
  127. * @suppress {unusedLocalVariables} f is only used for nested messages
  128. */
  129. proto.spine.base.FieldPath.serializeBinaryToWriter = function(message, writer) {
  130. var f = undefined;
  131. f = message.getFieldNameList();
  132. if (f.length > 0) {
  133. writer.writeRepeatedString(
  134. 1,
  135. f
  136. );
  137. }
  138. };
  139. /**
  140. * repeated string field_name = 1;
  141. * @return {!Array<string>}
  142. */
  143. proto.spine.base.FieldPath.prototype.getFieldNameList = function() {
  144. return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 1));
  145. };
  146. /**
  147. * @param {!Array<string>} value
  148. * @return {!proto.spine.base.FieldPath} returns this
  149. */
  150. proto.spine.base.FieldPath.prototype.setFieldNameList = function(value) {
  151. return jspb.Message.setField(this, 1, value || []);
  152. };
  153. /**
  154. * @param {string} value
  155. * @param {number=} opt_index
  156. * @return {!proto.spine.base.FieldPath} returns this
  157. */
  158. proto.spine.base.FieldPath.prototype.addFieldName = function(value, opt_index) {
  159. return jspb.Message.addToRepeatedField(this, 1, value, opt_index);
  160. };
  161. /**
  162. * Clears the list making it empty but non-null.
  163. * @return {!proto.spine.base.FieldPath} returns this
  164. */
  165. proto.spine.base.FieldPath.prototype.clearFieldNameList = function() {
  166. return this.setFieldNameList([]);
  167. };
  168. goog.object.extend(exports, proto.spine.base);
  169. // Generated by Spine ProtoJs Plugin
  170. let ObjectParser = require('../../../client/parser/object-parser.js').default;
  171. let TypeParsers = require('../../../client/parser/type-parsers.js').default;
  172. proto.spine.base.FieldPath.Parser = function() {
  173. ObjectParser.call(this);
  174. };
  175. proto.spine.base.FieldPath.Parser.prototype = Object.create(ObjectParser.prototype);
  176. proto.spine.base.FieldPath.Parser.prototype.constructor = proto.spine.base.FieldPath.Parser;
  177. proto.spine.base.FieldPath.Parser.prototype.fromObject = function(obj) {
  178. if (obj === null) {
  179. return null;
  180. }
  181. let msg = new proto.spine.base.FieldPath();
  182. if (obj.fieldName !== undefined && obj.fieldName !== null) {
  183. obj.fieldName.forEach(
  184. (listItem, index, array) => {
  185. if (listItem !== null) {
  186. let value = listItem;
  187. msg.addFieldName(value);
  188. }
  189. }
  190. );
  191. }
  192. return msg;
  193. };
  194. // Generated by Spine ProtoJs Plugin
  195. proto.spine.base.FieldPath.typeUrl = function() {
  196. return 'type.spine.io/spine.base.FieldPath';
  197. };