package_test.pb.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. // Copyright 2008 The Closure Library Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS-IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. // All other code copyright its respective owners(s).
  15. /**
  16. * @fileoverview Generated Protocol Buffer code for file
  17. * closure/goog/proto2/package_test.proto.
  18. */
  19. goog.provide('someprotopackage.TestPackageTypes');
  20. goog.setTestOnly('someprotopackage.TestPackageTypes');
  21. goog.require('goog.proto2.Message');
  22. goog.require('proto2.TestAllTypes');
  23. /**
  24. * Message TestPackageTypes.
  25. * @constructor
  26. * @extends {goog.proto2.Message}
  27. * @final
  28. */
  29. someprotopackage.TestPackageTypes = function() {
  30. goog.proto2.Message.call(this);
  31. };
  32. goog.inherits(someprotopackage.TestPackageTypes, goog.proto2.Message);
  33. /**
  34. * Descriptor for this message, deserialized lazily in getDescriptor().
  35. * @private {?goog.proto2.Descriptor}
  36. */
  37. someprotopackage.TestPackageTypes.descriptor_ = null;
  38. /**
  39. * Overrides {@link goog.proto2.Message#clone} to specify its exact return type.
  40. * @return {!someprotopackage.TestPackageTypes} The cloned message.
  41. * @override
  42. */
  43. someprotopackage.TestPackageTypes.prototype.clone;
  44. /**
  45. * Gets the value of the optional_int32 field.
  46. * @return {?number} The value.
  47. */
  48. someprotopackage.TestPackageTypes.prototype.getOptionalInt32 = function() {
  49. return /** @type {?number} */ (this.get$Value(1));
  50. };
  51. /**
  52. * Gets the value of the optional_int32 field or the default value if not set.
  53. * @return {number} The value.
  54. */
  55. someprotopackage.TestPackageTypes.prototype.getOptionalInt32OrDefault = function() {
  56. return /** @type {number} */ (this.get$ValueOrDefault(1));
  57. };
  58. /**
  59. * Sets the value of the optional_int32 field.
  60. * @param {number} value The value.
  61. */
  62. someprotopackage.TestPackageTypes.prototype.setOptionalInt32 = function(value) {
  63. this.set$Value(1, value);
  64. };
  65. /**
  66. * @return {boolean} Whether the optional_int32 field has a value.
  67. */
  68. someprotopackage.TestPackageTypes.prototype.hasOptionalInt32 = function() {
  69. return this.has$Value(1);
  70. };
  71. /**
  72. * @return {number} The number of values in the optional_int32 field.
  73. */
  74. someprotopackage.TestPackageTypes.prototype.optionalInt32Count = function() {
  75. return this.count$Values(1);
  76. };
  77. /**
  78. * Clears the values in the optional_int32 field.
  79. */
  80. someprotopackage.TestPackageTypes.prototype.clearOptionalInt32 = function() {
  81. this.clear$Field(1);
  82. };
  83. /**
  84. * Gets the value of the other_all field.
  85. * @return {?proto2.TestAllTypes} The value.
  86. */
  87. someprotopackage.TestPackageTypes.prototype.getOtherAll = function() {
  88. return /** @type {?proto2.TestAllTypes} */ (this.get$Value(2));
  89. };
  90. /**
  91. * Gets the value of the other_all field or the default value if not set.
  92. * @return {!proto2.TestAllTypes} The value.
  93. */
  94. someprotopackage.TestPackageTypes.prototype.getOtherAllOrDefault = function() {
  95. return /** @type {!proto2.TestAllTypes} */ (this.get$ValueOrDefault(2));
  96. };
  97. /**
  98. * Sets the value of the other_all field.
  99. * @param {!proto2.TestAllTypes} value The value.
  100. */
  101. someprotopackage.TestPackageTypes.prototype.setOtherAll = function(value) {
  102. this.set$Value(2, value);
  103. };
  104. /**
  105. * @return {boolean} Whether the other_all field has a value.
  106. */
  107. someprotopackage.TestPackageTypes.prototype.hasOtherAll = function() {
  108. return this.has$Value(2);
  109. };
  110. /**
  111. * @return {number} The number of values in the other_all field.
  112. */
  113. someprotopackage.TestPackageTypes.prototype.otherAllCount = function() {
  114. return this.count$Values(2);
  115. };
  116. /**
  117. * Clears the values in the other_all field.
  118. */
  119. someprotopackage.TestPackageTypes.prototype.clearOtherAll = function() {
  120. this.clear$Field(2);
  121. };
  122. /** @override */
  123. someprotopackage.TestPackageTypes.prototype.getDescriptor = function() {
  124. var descriptor = someprotopackage.TestPackageTypes.descriptor_;
  125. if (!descriptor) {
  126. // The descriptor is created lazily when we instantiate a new instance.
  127. var descriptorObj = {
  128. 0: {
  129. name: 'TestPackageTypes',
  130. fullName: 'someprotopackage.TestPackageTypes'
  131. },
  132. 1: {
  133. name: 'optional_int32',
  134. fieldType: goog.proto2.Message.FieldType.INT32,
  135. type: Number
  136. },
  137. 2: {
  138. name: 'other_all',
  139. fieldType: goog.proto2.Message.FieldType.MESSAGE,
  140. type: proto2.TestAllTypes
  141. }
  142. };
  143. someprotopackage.TestPackageTypes.descriptor_ = descriptor =
  144. goog.proto2.Message.createDescriptor(
  145. someprotopackage.TestPackageTypes, descriptorObj);
  146. }
  147. return descriptor;
  148. };
  149. /** @nocollapse */
  150. someprotopackage.TestPackageTypes.getDescriptor =
  151. someprotopackage.TestPackageTypes.prototype.getDescriptor;