timerange.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /**
  2. * @fileoverview
  3. * @enhanceable
  4. * @public
  5. */
  6. // GENERATED CODE -- DO NOT EDIT!
  7. goog.provide('proto.transit_realtime.TimeRange');
  8. goog.require('jspb.Message');
  9. /**
  10. * Generated by JsPbCodeGenerator.
  11. * @param {Array=} opt_data Optional initial data array, typically from a
  12. * server response, or constructed directly in Javascript. The array is used
  13. * in place and becomes part of the constructed object. It is not cloned.
  14. * If no data is provided, the constructed object will be empty, but still
  15. * valid.
  16. * @extends {jspb.Message}
  17. * @constructor
  18. */
  19. proto.transit_realtime.TimeRange = function(opt_data) {
  20. jspb.Message.initialize(this, opt_data, 0, 3, null, null);
  21. };
  22. goog.inherits(proto.transit_realtime.TimeRange, jspb.Message);
  23. if (goog.DEBUG && !COMPILED) {
  24. proto.transit_realtime.TimeRange.displayName = 'proto.transit_realtime.TimeRange';
  25. }
  26. if (jspb.Message.GENERATE_TO_OBJECT) {
  27. /**
  28. * Creates an object representation of this proto suitable for use in Soy templates.
  29. * Field names that are reserved in JavaScript and will be renamed to pb_name.
  30. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
  31. * For the list of reserved names please see:
  32. * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
  33. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance
  34. * for transitional soy proto support: http://goto/soy-param-migration
  35. * @return {!Object}
  36. */
  37. proto.transit_realtime.TimeRange.prototype.toObject = function(opt_includeInstance) {
  38. return proto.transit_realtime.TimeRange.toObject(opt_includeInstance, this);
  39. };
  40. /**
  41. * Static version of the {@see toObject} method.
  42. * @param {boolean|undefined} includeInstance Whether to include the JSPB
  43. * instance for transitional soy proto support:
  44. * http://goto/soy-param-migration
  45. * @param {!proto.transit_realtime.TimeRange} msg The msg instance to transform.
  46. * @return {!Object}
  47. */
  48. proto.transit_realtime.TimeRange.toObject = function(includeInstance, msg) {
  49. var f, obj = {
  50. start: jspb.Message.getField(msg, 1),
  51. end: jspb.Message.getField(msg, 2)
  52. };
  53. jspb.Message.toObjectExtension(/** @type {!jspb.Message} */ (msg), obj,
  54. proto.transit_realtime.TimeRange.extensions, proto.transit_realtime.TimeRange.prototype.getExtension,
  55. includeInstance);
  56. if (includeInstance) {
  57. obj.$jspbMessageInstance = msg;
  58. }
  59. return obj;
  60. };
  61. }
  62. /**
  63. * Creates a deep clone of this proto. No data is shared with the original.
  64. * @return {!proto.transit_realtime.TimeRange} The clone.
  65. */
  66. proto.transit_realtime.TimeRange.prototype.cloneMessage = function() {
  67. return /** @type {!proto.transit_realtime.TimeRange} */ (jspb.Message.cloneMessage(this));
  68. };
  69. /**
  70. * optional uint64 start = 1;
  71. * @return {number}
  72. */
  73. proto.transit_realtime.TimeRange.prototype.getStart = function() {
  74. return /** @type {number} */ (!this.hasStart() ? 0 : jspb.Message.getField(this, 1));
  75. };
  76. /** @param {number?|undefined} value */
  77. proto.transit_realtime.TimeRange.prototype.setStart = function(value) {
  78. jspb.Message.setField(this, 1, value);
  79. };
  80. proto.transit_realtime.TimeRange.prototype.clearStart = function() {
  81. jspb.Message.setField(this, 1, undefined);
  82. };
  83. /**
  84. * Returns whether this field is set.
  85. * @return{!boolean}
  86. */
  87. proto.transit_realtime.TimeRange.prototype.hasStart = function() {
  88. return jspb.Message.getField(this, 1) != null;
  89. };
  90. /**
  91. * optional uint64 end = 2;
  92. * @return {number}
  93. */
  94. proto.transit_realtime.TimeRange.prototype.getEnd = function() {
  95. return /** @type {number} */ (!this.hasEnd() ? 0 : jspb.Message.getField(this, 2));
  96. };
  97. /** @param {number?|undefined} value */
  98. proto.transit_realtime.TimeRange.prototype.setEnd = function(value) {
  99. jspb.Message.setField(this, 2, value);
  100. };
  101. proto.transit_realtime.TimeRange.prototype.clearEnd = function() {
  102. jspb.Message.setField(this, 2, undefined);
  103. };
  104. /**
  105. * Returns whether this field is set.
  106. * @return{!boolean}
  107. */
  108. proto.transit_realtime.TimeRange.prototype.hasEnd = function() {
  109. return jspb.Message.getField(this, 2) != null;
  110. };
  111. /**
  112. * The extensions registered with this message class. This is a map of
  113. * extension field number to fieldInfo object.
  114. *
  115. * For example:
  116. * { 123: {fieldIndex: 123, fieldName: {my_field_name: 0}, ctor: proto.example.MyMessage} }
  117. *
  118. * fieldName contains the JsCompiler renamed field name property so that it
  119. * works in OPTIMIZED mode.
  120. *
  121. * @type {!Object.<number, jspb.ExtensionFieldInfo>}
  122. */
  123. proto.transit_realtime.TimeRange.extensions = {};