translatedstring.js 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. /**
  2. * @fileoverview
  3. * @enhanceable
  4. * @public
  5. */
  6. // GENERATED CODE -- DO NOT EDIT!
  7. goog.provide('proto.transit_realtime.TranslatedString');
  8. goog.provide('proto.transit_realtime.TranslatedString.Translation');
  9. goog.require('jspb.Message');
  10. /**
  11. * Generated by JsPbCodeGenerator.
  12. * @param {Array=} opt_data Optional initial data array, typically from a
  13. * server response, or constructed directly in Javascript. The array is used
  14. * in place and becomes part of the constructed object. It is not cloned.
  15. * If no data is provided, the constructed object will be empty, but still
  16. * valid.
  17. * @extends {jspb.Message}
  18. * @constructor
  19. */
  20. proto.transit_realtime.TranslatedString = function(opt_data) {
  21. jspb.Message.initialize(this, opt_data, 0, 2, proto.transit_realtime.TranslatedString.repeatedFields_, null);
  22. };
  23. goog.inherits(proto.transit_realtime.TranslatedString, jspb.Message);
  24. if (goog.DEBUG && !COMPILED) {
  25. proto.transit_realtime.TranslatedString.displayName = 'proto.transit_realtime.TranslatedString';
  26. }
  27. /**
  28. * List of repeated fields within this message type.
  29. * @private {!Array<number>}
  30. * @const
  31. */
  32. proto.transit_realtime.TranslatedString.repeatedFields_ = [1];
  33. if (jspb.Message.GENERATE_TO_OBJECT) {
  34. /**
  35. * Creates an object representation of this proto suitable for use in Soy templates.
  36. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  37. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  38. * For the list of reserved names please see:
  39. * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
  40. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
  41. * for transitional soy proto support: http://goto/soy-param-migration
  42. * @return {!Object}
  43. */
  44. proto.transit_realtime.TranslatedString.prototype.toObject = function(opt_includeInstance) {
  45. return proto.transit_realtime.TranslatedString.toObject(opt_includeInstance, this);
  46. };
  47. /**
  48. * Static version of the {@see toObject} method.
  49. * @param {boolean|undefined} includeInstance Whether to include the JSPB
  50. * instance for transitional soy proto support:
  51. * http://goto/soy-param-migration
  52. * @param {!proto.transit_realtime.TranslatedString} msg The msg instance to transform.
  53. * @return {!Object}
  54. */
  55. proto.transit_realtime.TranslatedString.toObject = function(includeInstance, msg) {
  56. var f, obj = {
  57. translationList: jspb.Message.toObjectList(msg.getTranslationList(),
  58. proto.transit_realtime.TranslatedString.Translation.toObject, includeInstance)
  59. };
  60. jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
  61. proto.transit_realtime.TranslatedString.extensions, proto.transit_realtime.TranslatedString.prototype.getExtension,
  62. includeInstance);
  63. if (includeInstance) {
  64. obj.$jspbMessageInstance = msg;
  65. }
  66. return obj;
  67. };
  68. }
  69. /**
  70. * Creates a deep clone of this proto. No data is shared with the original.
  71. * @return {!proto.transit_realtime.TranslatedString} The clone.
  72. */
  73. proto.transit_realtime.TranslatedString.prototype.cloneMessage = function() {
  74. return /** @type {!proto.transit_realtime.TranslatedString} */ (jspb.Message.cloneMessage(this));
  75. };
  76. /**
  77. * repeated Translation translation = 1;
  78. * If you change this array by adding, removing or replacing elements, or if you
  79. * replace the array itself, then you must call the setter to update it.
  80. * @return {!Array.<!proto.transit_realtime.TranslatedString.Translation>}
  81. */
  82. proto.transit_realtime.TranslatedString.prototype.getTranslationList = function() {
  83. return /** @type{!Array.<!proto.transit_realtime.TranslatedString.Translation>} */ (
  84. jspb.Message.getRepeatedWrapperField(this, proto.transit_realtime.TranslatedString.Translation, 1));
  85. };
  86. /** @param {Array.<!proto.transit_realtime.TranslatedString.Translation>} value */
  87. proto.transit_realtime.TranslatedString.prototype.setTranslationList = function(value) {
  88. jspb.Message.setRepeatedWrapperField(this, 1, value);
  89. };
  90. proto.transit_realtime.TranslatedString.prototype.clearTranslationList = function() {
  91. this.setTranslationList([]);
  92. };
  93. /**
  94. * The extensions registered with this message class. This is a map of
  95. * extension field number to fieldInfo object.
  96. *
  97. * For example:
  98. * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
  99. *
  100. * fieldName contains the JsCompiler renamed field name property so that it
  101. * works in OPTIMIZED mode.
  102. *
  103. * @type {!Object.<number, jspb.ExtensionFieldInfo>}
  104. */
  105. proto.transit_realtime.TranslatedString.extensions = {};
  106. /**
  107. * Generated by JsPbCodeGenerator.
  108. * @param {Array=} opt_data Optional initial data array, typically from a
  109. * server response, or constructed directly in Javascript. The array is used
  110. * in place and becomes part of the constructed object. It is not cloned.
  111. * If no data is provided, the constructed object will be empty, but still
  112. * valid.
  113. * @extends {jspb.Message}
  114. * @constructor
  115. */
  116. proto.transit_realtime.TranslatedString.Translation = function(opt_data) {
  117. jspb.Message.initialize(this, opt_data, 0, 3, null, null);
  118. };
  119. goog.inherits(proto.transit_realtime.TranslatedString.Translation, jspb.Message);
  120. if (goog.DEBUG && !COMPILED) {
  121. proto.transit_realtime.TranslatedString.Translation.displayName = 'proto.transit_realtime.TranslatedString.Translation';
  122. }
  123. if (jspb.Message.GENERATE_TO_OBJECT) {
  124. /**
  125. * Creates an object representation of this proto suitable for use in Soy templates.
  126. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  127. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  128. * For the list of reserved names please see:
  129. * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
  130. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
  131. * for transitional soy proto support: http://goto/soy-param-migration
  132. * @return {!Object}
  133. */
  134. proto.transit_realtime.TranslatedString.Translation.prototype.toObject = function(opt_includeInstance) {
  135. return proto.transit_realtime.TranslatedString.Translation.toObject(opt_includeInstance, this);
  136. };
  137. /**
  138. * Static version of the {@see toObject} method.
  139. * @param {boolean|undefined} includeInstance Whether to include the JSPB
  140. * instance for transitional soy proto support:
  141. * http://goto/soy-param-migration
  142. * @param {!proto.transit_realtime.TranslatedString.Translation} msg The msg instance to transform.
  143. * @return {!Object}
  144. */
  145. proto.transit_realtime.TranslatedString.Translation.toObject = function(includeInstance, msg) {
  146. var f, obj = {
  147. text: jspb.Message.getField(msg, 1),
  148. language: jspb.Message.getField(msg, 2)
  149. };
  150. jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
  151. proto.transit_realtime.TranslatedString.Translation.extensions, proto.transit_realtime.TranslatedString.Translation.prototype.getExtension,
  152. includeInstance);
  153. if (includeInstance) {
  154. obj.$jspbMessageInstance = msg;
  155. }
  156. return obj;
  157. };
  158. }
  159. /**
  160. * Creates a deep clone of this proto. No data is shared with the original.
  161. * @return {!proto.transit_realtime.TranslatedString.Translation} The clone.
  162. */
  163. proto.transit_realtime.TranslatedString.Translation.prototype.cloneMessage = function() {
  164. return /** @type {!proto.transit_realtime.TranslatedString.Translation} */ (jspb.Message.cloneMessage(this));
  165. };
  166. /**
  167. * required string text = 1;
  168. * @return {string}
  169. */
  170. proto.transit_realtime.TranslatedString.Translation.prototype.getText = function() {
  171. return /** @type {string} */ (!this.hasText() ? "" : jspb.Message.getField(this, 1));
  172. };
  173. /** @param {string|undefined} value */
  174. proto.transit_realtime.TranslatedString.Translation.prototype.setText = function(value) {
  175. jspb.Message.setField(this, 1, value);
  176. };
  177. proto.transit_realtime.TranslatedString.Translation.prototype.clearText = function() {
  178. jspb.Message.setField(this, 1, undefined);
  179. };
  180. /**
  181. * Returns whether this field is set.
  182. * @return{!boolean}
  183. */
  184. proto.transit_realtime.TranslatedString.Translation.prototype.hasText = function() {
  185. return jspb.Message.getField(this, 1) != null;
  186. };
  187. /**
  188. * optional string language = 2;
  189. * @return {string}
  190. */
  191. proto.transit_realtime.TranslatedString.Translation.prototype.getLanguage = function() {
  192. return /** @type {string} */ (!this.hasLanguage() ? "" : jspb.Message.getField(this, 2));
  193. };
  194. /** @param {string?|undefined} value */
  195. proto.transit_realtime.TranslatedString.Translation.prototype.setLanguage = function(value) {
  196. jspb.Message.setField(this, 2, value);
  197. };
  198. proto.transit_realtime.TranslatedString.Translation.prototype.clearLanguage = function() {
  199. jspb.Message.setField(this, 2, undefined);
  200. };
  201. /**
  202. * Returns whether this field is set.
  203. * @return{!boolean}
  204. */
  205. proto.transit_realtime.TranslatedString.Translation.prototype.hasLanguage = function() {
  206. return jspb.Message.getField(this, 2) != null;
  207. };
  208. /**
  209. * The extensions registered with this message class. This is a map of
  210. * extension field number to fieldInfo object.
  211. *
  212. * For example:
  213. * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
  214. *
  215. * fieldName contains the JsCompiler renamed field name property so that it
  216. * works in OPTIMIZED mode.
  217. *
  218. * @type {!Object.<number, jspb.ExtensionFieldInfo>}
  219. */
  220. proto.transit_realtime.TranslatedString.Translation.extensions = {};