Source: proto/google/protobuf/source_context_pb.js

  1. // source: google/protobuf/source_context.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. goog.exportSymbol('proto.google.protobuf.SourceContext', null, global);
  14. /**
  15. * Generated by JsPbCodeGenerator.
  16. * @param {Array=} opt_data Optional initial data array, typically from a
  17. * server response, or constructed directly in Javascript. The array is used
  18. * in place and becomes part of the constructed object. It is not cloned.
  19. * If no data is provided, the constructed object will be empty, but still
  20. * valid.
  21. * @extends {jspb.Message}
  22. * @constructor
  23. */
  24. proto.google.protobuf.SourceContext = function(opt_data) {
  25. jspb.Message.initialize(this, opt_data, 0, -1, null, null);
  26. };
  27. goog.inherits(proto.google.protobuf.SourceContext, jspb.Message);
  28. if (goog.DEBUG && !COMPILED) {
  29. /**
  30. * @public
  31. * @override
  32. */
  33. proto.google.protobuf.SourceContext.displayName = 'proto.google.protobuf.SourceContext';
  34. }
  35. if (jspb.Message.GENERATE_TO_OBJECT) {
  36. /**
  37. * Creates an object representation of this proto.
  38. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  39. * Optional fields that are not set will be set to undefined.
  40. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  41. * For the list of reserved names please see:
  42. * net/proto2/compiler/js/internal/generator.cc#kKeyword.
  43. * @param {boolean=} opt_includeInstance Deprecated. whether to include the
  44. * JSPB instance for transitional soy proto support:
  45. * http://goto/soy-param-migration
  46. * @return {!Object}
  47. */
  48. proto.google.protobuf.SourceContext.prototype.toObject = function(opt_includeInstance) {
  49. return proto.google.protobuf.SourceContext.toObject(opt_includeInstance, this);
  50. };
  51. /**
  52. * Static version of the {@see toObject} method.
  53. * @param {boolean|undefined} includeInstance Deprecated. Whether to include
  54. * the JSPB instance for transitional soy proto support:
  55. * http://goto/soy-param-migration
  56. * @param {!proto.google.protobuf.SourceContext} msg The msg instance to transform.
  57. * @return {!Object}
  58. * @suppress {unusedLocalVariables} f is only used for nested messages
  59. */
  60. proto.google.protobuf.SourceContext.toObject = function(includeInstance, msg) {
  61. var f, obj = {
  62. fileName: jspb.Message.getFieldWithDefault(msg, 1, "")
  63. };
  64. if (includeInstance) {
  65. obj.$jspbMessageInstance = msg;
  66. }
  67. return obj;
  68. };
  69. }
  70. /**
  71. * Deserializes binary data (in protobuf wire format).
  72. * @param {jspb.ByteSource} bytes The bytes to deserialize.
  73. * @return {!proto.google.protobuf.SourceContext}
  74. */
  75. proto.google.protobuf.SourceContext.deserializeBinary = function(bytes) {
  76. var reader = new jspb.BinaryReader(bytes);
  77. var msg = new proto.google.protobuf.SourceContext;
  78. return proto.google.protobuf.SourceContext.deserializeBinaryFromReader(msg, reader);
  79. };
  80. /**
  81. * Deserializes binary data (in protobuf wire format) from the
  82. * given reader into the given message object.
  83. * @param {!proto.google.protobuf.SourceContext} msg The message object to deserialize into.
  84. * @param {!jspb.BinaryReader} reader The BinaryReader to use.
  85. * @return {!proto.google.protobuf.SourceContext}
  86. */
  87. proto.google.protobuf.SourceContext.deserializeBinaryFromReader = function(msg, reader) {
  88. while (reader.nextField()) {
  89. if (reader.isEndGroup()) {
  90. break;
  91. }
  92. var field = reader.getFieldNumber();
  93. switch (field) {
  94. case 1:
  95. var value = /** @type {string} */ (reader.readString());
  96. msg.setFileName(value);
  97. break;
  98. default:
  99. reader.skipField();
  100. break;
  101. }
  102. }
  103. return msg;
  104. };
  105. /**
  106. * Serializes the message to binary data (in protobuf wire format).
  107. * @return {!Uint8Array}
  108. */
  109. proto.google.protobuf.SourceContext.prototype.serializeBinary = function() {
  110. var writer = new jspb.BinaryWriter();
  111. proto.google.protobuf.SourceContext.serializeBinaryToWriter(this, writer);
  112. return writer.getResultBuffer();
  113. };
  114. /**
  115. * Serializes the given message to binary data (in protobuf wire
  116. * format), writing to the given BinaryWriter.
  117. * @param {!proto.google.protobuf.SourceContext} message
  118. * @param {!jspb.BinaryWriter} writer
  119. * @suppress {unusedLocalVariables} f is only used for nested messages
  120. */
  121. proto.google.protobuf.SourceContext.serializeBinaryToWriter = function(message, writer) {
  122. var f = undefined;
  123. f = message.getFileName();
  124. if (f.length > 0) {
  125. writer.writeString(
  126. 1,
  127. f
  128. );
  129. }
  130. };
  131. /**
  132. * optional string file_name = 1;
  133. * @return {string}
  134. */
  135. proto.google.protobuf.SourceContext.prototype.getFileName = function() {
  136. return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
  137. };
  138. /**
  139. * @param {string} value
  140. * @return {!proto.google.protobuf.SourceContext} returns this
  141. */
  142. proto.google.protobuf.SourceContext.prototype.setFileName = function(value) {
  143. return jspb.Message.setProto3StringField(this, 1, value);
  144. };
  145. goog.object.extend(exports, proto.google.protobuf);
  146. // Generated by Spine ProtoJs Plugin
  147. proto.google.protobuf.SourceContext.typeUrl = function() {
  148. return 'type.googleapis.com/google.protobuf.SourceContext';
  149. };