3 * Protocol Buffer 2 Copyright 2008 Google Inc.
4 * All other code copyright its respective owners.
5 * Copyright (C) 2010 The Libphonenumber Authors
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 * @fileoverview Generated Protocol Buffer code for file
25 goog.provide('i18n.phonenumbers.PhoneNumber');
26 goog.provide('i18n.phonenumbers.PhoneNumber.CountryCodeSource');
28 goog.require('goog.proto2.Message');
33 * Message PhoneNumber.
35 * @extends {goog.proto2.Message}
37 i18n.phonenumbers.PhoneNumber = function() {
38 goog.proto2.Message.apply(this);
40 goog.inherits(i18n.phonenumbers.PhoneNumber, goog.proto2.Message);
44 * Overrides {@link goog.proto2.Message#clone} to specify its exact return type.
45 * @return {!i18n.phonenumbers.PhoneNumber} The cloned message.
48 i18n.phonenumbers.PhoneNumber.prototype.clone;
52 * Gets the value of the country_code field.
53 * @return {?number} The value.
55 i18n.phonenumbers.PhoneNumber.prototype.getCountryCode = function() {
56 return /** @type {?number} */ (this.get$Value(1));
61 * Gets the value of the country_code field or the default value if not set.
62 * @return {number} The value.
64 i18n.phonenumbers.PhoneNumber.prototype.getCountryCodeOrDefault = function() {
65 return /** @type {number} */ (this.get$ValueOrDefault(1));
70 * Sets the value of the country_code field.
71 * @param {number} value The value.
73 i18n.phonenumbers.PhoneNumber.prototype.setCountryCode = function(value) {
74 this.set$Value(1, value);
79 * @return {boolean} Whether the country_code field has a value.
81 i18n.phonenumbers.PhoneNumber.prototype.hasCountryCode = function() {
82 return this.has$Value(1);
87 * @return {number} The number of values in the country_code field.
89 i18n.phonenumbers.PhoneNumber.prototype.countryCodeCount = function() {
90 return this.count$Values(1);
95 * Clears the values in the country_code field.
97 i18n.phonenumbers.PhoneNumber.prototype.clearCountryCode = function() {
103 * Gets the value of the national_number field.
104 * @return {?number} The value.
106 i18n.phonenumbers.PhoneNumber.prototype.getNationalNumber = function() {
107 return /** @type {?number} */ (this.get$Value(2));
112 * Gets the value of the national_number field or the default value if not set.
113 * @return {number} The value.
115 i18n.phonenumbers.PhoneNumber.prototype.getNationalNumberOrDefault = function() {
116 return /** @type {number} */ (this.get$ValueOrDefault(2));
121 * Sets the value of the national_number field.
122 * @param {number} value The value.
124 i18n.phonenumbers.PhoneNumber.prototype.setNationalNumber = function(value) {
125 this.set$Value(2, value);
130 * @return {boolean} Whether the national_number field has a value.
132 i18n.phonenumbers.PhoneNumber.prototype.hasNationalNumber = function() {
133 return this.has$Value(2);
138 * @return {number} The number of values in the national_number field.
140 i18n.phonenumbers.PhoneNumber.prototype.nationalNumberCount = function() {
141 return this.count$Values(2);
146 * Clears the values in the national_number field.
148 i18n.phonenumbers.PhoneNumber.prototype.clearNationalNumber = function() {
154 * Gets the value of the extension field.
155 * @return {?string} The value.
157 i18n.phonenumbers.PhoneNumber.prototype.getExtension = function() {
158 return /** @type {?string} */ (this.get$Value(3));
163 * Gets the value of the extension field or the default value if not set.
164 * @return {string} The value.
166 i18n.phonenumbers.PhoneNumber.prototype.getExtensionOrDefault = function() {
167 return /** @type {string} */ (this.get$ValueOrDefault(3));
172 * Sets the value of the extension field.
173 * @param {string} value The value.
175 i18n.phonenumbers.PhoneNumber.prototype.setExtension = function(value) {
176 this.set$Value(3, value);
181 * @return {boolean} Whether the extension field has a value.
183 i18n.phonenumbers.PhoneNumber.prototype.hasExtension = function() {
184 return this.has$Value(3);
189 * @return {number} The number of values in the extension field.
191 i18n.phonenumbers.PhoneNumber.prototype.extensionCount = function() {
192 return this.count$Values(3);
197 * Clears the values in the extension field.
199 i18n.phonenumbers.PhoneNumber.prototype.clearExtension = function() {
205 * Gets the value of the italian_leading_zero field.
206 * @return {?boolean} The value.
208 i18n.phonenumbers.PhoneNumber.prototype.getItalianLeadingZero = function() {
209 return /** @type {?boolean} */ (this.get$Value(4));
214 * Gets the value of the italian_leading_zero field or the default value if not set.
215 * @return {boolean} The value.
217 i18n.phonenumbers.PhoneNumber.prototype.getItalianLeadingZeroOrDefault = function() {
218 return /** @type {boolean} */ (this.get$ValueOrDefault(4));
223 * Sets the value of the italian_leading_zero field.
224 * @param {boolean} value The value.
226 i18n.phonenumbers.PhoneNumber.prototype.setItalianLeadingZero = function(value) {
227 this.set$Value(4, value);
232 * @return {boolean} Whether the italian_leading_zero field has a value.
234 i18n.phonenumbers.PhoneNumber.prototype.hasItalianLeadingZero = function() {
235 return this.has$Value(4);
240 * @return {number} The number of values in the italian_leading_zero field.
242 i18n.phonenumbers.PhoneNumber.prototype.italianLeadingZeroCount = function() {
243 return this.count$Values(4);
248 * Clears the values in the italian_leading_zero field.
250 i18n.phonenumbers.PhoneNumber.prototype.clearItalianLeadingZero = function() {
256 * Gets the value of the number_of_leading_zeros field.
257 * @return {?number} The value.
259 i18n.phonenumbers.PhoneNumber.prototype.getNumberOfLeadingZeros = function() {
260 return /** @type {?number} */ (this.get$Value(8));
265 * Gets the value of the number_of_leading_zeros field or the default value if not set.
266 * @return {number} The value.
268 i18n.phonenumbers.PhoneNumber.prototype.getNumberOfLeadingZerosOrDefault = function() {
269 return /** @type {number} */ (this.get$ValueOrDefault(8));
274 * Sets the value of the number_of_leading_zeros field.
275 * @param {number} value The value.
277 i18n.phonenumbers.PhoneNumber.prototype.setNumberOfLeadingZeros = function(value) {
278 this.set$Value(8, value);
283 * @return {boolean} Whether the number_of_leading_zeros field has a value.
285 i18n.phonenumbers.PhoneNumber.prototype.hasNumberOfLeadingZeros = function() {
286 return this.has$Value(8);
291 * @return {number} The number of values in the number_of_leading_zeros field.
293 i18n.phonenumbers.PhoneNumber.prototype.numberOfLeadingZerosCount = function() {
294 return this.count$Values(8);
299 * Clears the values in the number_of_leading_zeros field.
301 i18n.phonenumbers.PhoneNumber.prototype.clearNumberOfLeadingZeros = function() {
307 * Gets the value of the raw_input field.
308 * @return {?string} The value.
310 i18n.phonenumbers.PhoneNumber.prototype.getRawInput = function() {
311 return /** @type {?string} */ (this.get$Value(5));
316 * Gets the value of the raw_input field or the default value if not set.
317 * @return {string} The value.
319 i18n.phonenumbers.PhoneNumber.prototype.getRawInputOrDefault = function() {
320 return /** @type {string} */ (this.get$ValueOrDefault(5));
325 * Sets the value of the raw_input field.
326 * @param {string} value The value.
328 i18n.phonenumbers.PhoneNumber.prototype.setRawInput = function(value) {
329 this.set$Value(5, value);
334 * @return {boolean} Whether the raw_input field has a value.
336 i18n.phonenumbers.PhoneNumber.prototype.hasRawInput = function() {
337 return this.has$Value(5);
342 * @return {number} The number of values in the raw_input field.
344 i18n.phonenumbers.PhoneNumber.prototype.rawInputCount = function() {
345 return this.count$Values(5);
350 * Clears the values in the raw_input field.
352 i18n.phonenumbers.PhoneNumber.prototype.clearRawInput = function() {
358 * Gets the value of the country_code_source field.
359 * @return {?i18n.phonenumbers.PhoneNumber.CountryCodeSource} The value.
361 i18n.phonenumbers.PhoneNumber.prototype.getCountryCodeSource = function() {
362 return /** @type {?i18n.phonenumbers.PhoneNumber.CountryCodeSource} */ (this.get$Value(6));
367 * Gets the value of the country_code_source field or the default value if not set.
368 * @return {i18n.phonenumbers.PhoneNumber.CountryCodeSource} The value.
370 i18n.phonenumbers.PhoneNumber.prototype.getCountryCodeSourceOrDefault = function() {
371 return /** @type {i18n.phonenumbers.PhoneNumber.CountryCodeSource} */ (this.get$ValueOrDefault(6));
376 * Sets the value of the country_code_source field.
377 * @param {i18n.phonenumbers.PhoneNumber.CountryCodeSource} value The value.
379 i18n.phonenumbers.PhoneNumber.prototype.setCountryCodeSource = function(value) {
380 this.set$Value(6, value);
385 * @return {boolean} Whether the country_code_source field has a value.
387 i18n.phonenumbers.PhoneNumber.prototype.hasCountryCodeSource = function() {
388 return this.has$Value(6);
393 * @return {number} The number of values in the country_code_source field.
395 i18n.phonenumbers.PhoneNumber.prototype.countryCodeSourceCount = function() {
396 return this.count$Values(6);
401 * Clears the values in the country_code_source field.
403 i18n.phonenumbers.PhoneNumber.prototype.clearCountryCodeSource = function() {
409 * Gets the value of the preferred_domestic_carrier_code field.
410 * @return {?string} The value.
412 i18n.phonenumbers.PhoneNumber.prototype.getPreferredDomesticCarrierCode = function() {
413 return /** @type {?string} */ (this.get$Value(7));
418 * Gets the value of the preferred_domestic_carrier_code field or the default value if not set.
419 * @return {string} The value.
421 i18n.phonenumbers.PhoneNumber.prototype.getPreferredDomesticCarrierCodeOrDefault = function() {
422 return /** @type {string} */ (this.get$ValueOrDefault(7));
427 * Sets the value of the preferred_domestic_carrier_code field.
428 * @param {string} value The value.
430 i18n.phonenumbers.PhoneNumber.prototype.setPreferredDomesticCarrierCode = function(value) {
431 this.set$Value(7, value);
436 * @return {boolean} Whether the preferred_domestic_carrier_code field has a value.
438 i18n.phonenumbers.PhoneNumber.prototype.hasPreferredDomesticCarrierCode = function() {
439 return this.has$Value(7);
444 * @return {number} The number of values in the preferred_domestic_carrier_code field.
446 i18n.phonenumbers.PhoneNumber.prototype.preferredDomesticCarrierCodeCount = function() {
447 return this.count$Values(7);
452 * Clears the values in the preferred_domestic_carrier_code field.
454 i18n.phonenumbers.PhoneNumber.prototype.clearPreferredDomesticCarrierCode = function() {
460 * Enumeration CountryCodeSource.
463 i18n.phonenumbers.PhoneNumber.CountryCodeSource = {
464 FROM_NUMBER_WITH_PLUS_SIGN: 1,
465 FROM_NUMBER_WITH_IDD: 5,
466 FROM_NUMBER_WITHOUT_PLUS_SIGN: 10,
467 FROM_DEFAULT_COUNTRY: 20
471 goog.proto2.Message.set$Metadata(i18n.phonenumbers.PhoneNumber, {
474 fullName: 'i18n.phonenumbers.PhoneNumber'
477 name: 'country_code',
479 fieldType: goog.proto2.Message.FieldType.INT32,
483 name: 'national_number',
485 fieldType: goog.proto2.Message.FieldType.UINT64,
490 fieldType: goog.proto2.Message.FieldType.STRING,
494 name: 'italian_leading_zero',
495 fieldType: goog.proto2.Message.FieldType.BOOL,
499 name: 'number_of_leading_zeros',
500 fieldType: goog.proto2.Message.FieldType.INT32,
506 fieldType: goog.proto2.Message.FieldType.STRING,
510 name: 'country_code_source',
511 fieldType: goog.proto2.Message.FieldType.ENUM,
512 defaultValue: i18n.phonenumbers.PhoneNumber.CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN,
513 type: i18n.phonenumbers.PhoneNumber.CountryCodeSource
516 name: 'preferred_domestic_carrier_code',
517 fieldType: goog.proto2.Message.FieldType.STRING,