| 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 |
/** |
| 17 |
* @fileoverview Generated Protocol Buffer code for file |
| 18 |
* closure/goog/proto2/package_test.proto. |
| 19 |
*/ |
| 20 |
|
| 21 |
goog.provide('someprotopackage.TestPackageTypes'); |
| 22 |
goog.setTestOnly('someprotopackage.TestPackageTypes'); |
| 23 |
|
| 24 |
goog.require('goog.proto2.Message'); |
| 25 |
goog.require('proto2.TestAllTypes'); |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
/** |
| 30 |
* Message TestPackageTypes. |
| 31 |
* @constructor |
| 32 |
* @extends {goog.proto2.Message} |
| 33 |
* @final |
| 34 |
*/ |
| 35 |
someprotopackage.TestPackageTypes = function() { |
| 36 |
goog.proto2.Message.call(this); |
| 37 |
}; |
| 38 |
goog.inherits(someprotopackage.TestPackageTypes, goog.proto2.Message); |
| 39 |
|
| 40 |
|
| 41 |
/** |
| 42 |
* Descriptor for this message, deserialized lazily in getDescriptor(). |
| 43 |
* @private {?goog.proto2.Descriptor} |
| 44 |
*/ |
| 45 |
someprotopackage.TestPackageTypes.descriptor_ = null; |
| 46 |
|
| 47 |
|
| 48 |
/** |
| 49 |
* Overrides {@link goog.proto2.Message#clone} to specify its exact return type. |
| 50 |
* @return {!someprotopackage.TestPackageTypes} The cloned message. |
| 51 |
* @override |
| 52 |
*/ |
| 53 |
someprotopackage.TestPackageTypes.prototype.clone; |
| 54 |
|
| 55 |
|
| 56 |
/** |
| 57 |
* Gets the value of the optional_int32 field. |
| 58 |
* @return {?number} The value. |
| 59 |
*/ |
| 60 |
someprotopackage.TestPackageTypes.prototype.getOptionalInt32 = function() { |
| 61 |
return /** @type {?number} */ (this.get$Value(1)); |
| 62 |
}; |
| 63 |
|
| 64 |
|
| 65 |
/** |
| 66 |
* Gets the value of the optional_int32 field or the default value if not set. |
| 67 |
* @return {number} The value. |
| 68 |
*/ |
| 69 |
someprotopackage.TestPackageTypes.prototype.getOptionalInt32OrDefault = function() { |
| 70 |
return /** @type {number} */ (this.get$ValueOrDefault(1)); |
| 71 |
}; |
| 72 |
|
| 73 |
|
| 74 |
/** |
| 75 |
* Sets the value of the optional_int32 field. |
| 76 |
* @param {number} value The value. |
| 77 |
*/ |
| 78 |
someprotopackage.TestPackageTypes.prototype.setOptionalInt32 = function(value) { |
| 79 |
this.set$Value(1, value); |
| 80 |
}; |
| 81 |
|
| 82 |
|
| 83 |
/** |
| 84 |
* @return {boolean} Whether the optional_int32 field has a value. |
| 85 |
*/ |
| 86 |
someprotopackage.TestPackageTypes.prototype.hasOptionalInt32 = function() { |
| 87 |
return this.has$Value(1); |
| 88 |
}; |
| 89 |
|
| 90 |
|
| 91 |
/** |
| 92 |
* @return {number} The number of values in the optional_int32 field. |
| 93 |
*/ |
| 94 |
someprotopackage.TestPackageTypes.prototype.optionalInt32Count = function() { |
| 95 |
return this.count$Values(1); |
| 96 |
}; |
| 97 |
|
| 98 |
|
| 99 |
/** |
| 100 |
* Clears the values in the optional_int32 field. |
| 101 |
*/ |
| 102 |
someprotopackage.TestPackageTypes.prototype.clearOptionalInt32 = function() { |
| 103 |
this.clear$Field(1); |
| 104 |
}; |
| 105 |
|
| 106 |
|
| 107 |
/** |
| 108 |
* Gets the value of the other_all field. |
| 109 |
* @return {?proto2.TestAllTypes} The value. |
| 110 |
*/ |
| 111 |
someprotopackage.TestPackageTypes.prototype.getOtherAll = function() { |
| 112 |
return /** @type {?proto2.TestAllTypes} */ (this.get$Value(2)); |
| 113 |
}; |
| 114 |
|
| 115 |
|
| 116 |
/** |
| 117 |
* Gets the value of the other_all field or the default value if not set. |
| 118 |
* @return {!proto2.TestAllTypes} The value. |
| 119 |
*/ |
| 120 |
someprotopackage.TestPackageTypes.prototype.getOtherAllOrDefault = function() { |
| 121 |
return /** @type {!proto2.TestAllTypes} */ (this.get$ValueOrDefault(2)); |
| 122 |
}; |
| 123 |
|
| 124 |
|
| 125 |
/** |
| 126 |
* Sets the value of the other_all field. |
| 127 |
* @param {!proto2.TestAllTypes} value The value. |
| 128 |
*/ |
| 129 |
someprotopackage.TestPackageTypes.prototype.setOtherAll = function(value) { |
| 130 |
this.set$Value(2, value); |
| 131 |
}; |
| 132 |
|
| 133 |
|
| 134 |
/** |
| 135 |
* @return {boolean} Whether the other_all field has a value. |
| 136 |
*/ |
| 137 |
someprotopackage.TestPackageTypes.prototype.hasOtherAll = function() { |
| 138 |
return this.has$Value(2); |
| 139 |
}; |
| 140 |
|
| 141 |
|
| 142 |
/** |
| 143 |
* @return {number} The number of values in the other_all field. |
| 144 |
*/ |
| 145 |
someprotopackage.TestPackageTypes.prototype.otherAllCount = function() { |
| 146 |
return this.count$Values(2); |
| 147 |
}; |
| 148 |
|
| 149 |
|
| 150 |
/** |
| 151 |
* Clears the values in the other_all field. |
| 152 |
*/ |
| 153 |
someprotopackage.TestPackageTypes.prototype.clearOtherAll = function() { |
| 154 |
this.clear$Field(2); |
| 155 |
}; |
| 156 |
|
| 157 |
|
| 158 |
/** @override */ |
| 159 |
someprotopackage.TestPackageTypes.prototype.getDescriptor = function() { |
| 160 |
var descriptor = someprotopackage.TestPackageTypes.descriptor_; |
| 161 |
if (!descriptor) { |
| 162 |
// The descriptor is created lazily when we instantiate a new instance. |
| 163 |
var descriptorObj = { |
| 164 |
0: { |
| 165 |
name: 'TestPackageTypes', |
| 166 |
fullName: 'someprotopackage.TestPackageTypes' |
| 167 |
}, |
| 168 |
1: { |
| 169 |
name: 'optional_int32', |
| 170 |
fieldType: goog.proto2.Message.FieldType.INT32, |
| 171 |
type: Number |
| 172 |
}, |
| 173 |
2: { |
| 174 |
name: 'other_all', |
| 175 |
fieldType: goog.proto2.Message.FieldType.MESSAGE, |
| 176 |
type: proto2.TestAllTypes |
| 177 |
} |
| 178 |
}; |
| 179 |
someprotopackage.TestPackageTypes.descriptor_ = descriptor = |
| 180 |
goog.proto2.Message.createDescriptor( |
| 181 |
someprotopackage.TestPackageTypes, descriptorObj); |
| 182 |
} |
| 183 |
return descriptor; |
| 184 |
}; |
| 185 |
|
| 186 |
|
| 187 |
/** @nocollapse */ |
| 188 |
someprotopackage.TestPackageTypes.getDescriptor = |
| 189 |
someprotopackage.TestPackageTypes.prototype.getDescriptor; |