source_context.js 5.1 KB

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