• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/**
2 * @license
3 * Protocol Buffer 2 Copyright 2008 Google Inc.
4 * All other code copyright its respective owners.
5 * Copyright (C) 2010 The Libphonenumber Authors
6 *
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
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
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.
18 */
19
20/**
21 * @fileoverview Generated Protocol Buffer code for file
22 * phonenumber.proto.
23 */
24
25goog.provide('i18n.phonenumbers.PhoneNumber');
26goog.provide('i18n.phonenumbers.PhoneNumber.CountryCodeSource');
27
28goog.require('goog.proto2.Message');
29
30
31
32/**
33 * Message PhoneNumber.
34 * @constructor
35 * @extends {goog.proto2.Message}
36 * @final
37 */
38i18n.phonenumbers.PhoneNumber = function() {
39  goog.proto2.Message.call(this);
40};
41goog.inherits(i18n.phonenumbers.PhoneNumber, goog.proto2.Message);
42
43
44/**
45 * Descriptor for this message, deserialized lazily in getDescriptor().
46 * @private {?goog.proto2.Descriptor}
47 */
48i18n.phonenumbers.PhoneNumber.descriptor_ = null;
49
50
51/**
52 * Overrides {@link goog.proto2.Message#clone} to specify its exact return type.
53 * @return {!i18n.phonenumbers.PhoneNumber} The cloned message.
54 * @override
55 */
56i18n.phonenumbers.PhoneNumber.prototype.clone;
57
58
59/**
60 * Gets the value of the country_code field.
61 * @return {?number} The value.
62 */
63i18n.phonenumbers.PhoneNumber.prototype.getCountryCode = function() {
64  return /** @type {?number} */ (this.get$Value(1));
65};
66
67
68/**
69 * Gets the value of the country_code field or the default value if not set.
70 * @return {number} The value.
71 */
72i18n.phonenumbers.PhoneNumber.prototype.getCountryCodeOrDefault = function() {
73  return /** @type {number} */ (this.get$ValueOrDefault(1));
74};
75
76
77/**
78 * Sets the value of the country_code field.
79 * @param {number} value The value.
80 */
81i18n.phonenumbers.PhoneNumber.prototype.setCountryCode = function(value) {
82  this.set$Value(1, value);
83};
84
85
86/**
87 * @return {boolean} Whether the country_code field has a value.
88 */
89i18n.phonenumbers.PhoneNumber.prototype.hasCountryCode = function() {
90  return this.has$Value(1);
91};
92
93
94/**
95 * @return {number} The number of values in the country_code field.
96 */
97i18n.phonenumbers.PhoneNumber.prototype.countryCodeCount = function() {
98  return this.count$Values(1);
99};
100
101
102/**
103 * Clears the values in the country_code field.
104 */
105i18n.phonenumbers.PhoneNumber.prototype.clearCountryCode = function() {
106  this.clear$Field(1);
107};
108
109
110/**
111 * Gets the value of the national_number field.
112 * @return {?number} The value.
113 */
114i18n.phonenumbers.PhoneNumber.prototype.getNationalNumber = function() {
115  return /** @type {?number} */ (this.get$Value(2));
116};
117
118
119/**
120 * Gets the value of the national_number field or the default value if not set.
121 * @return {number} The value.
122 */
123i18n.phonenumbers.PhoneNumber.prototype.getNationalNumberOrDefault = function() {
124  return /** @type {number} */ (this.get$ValueOrDefault(2));
125};
126
127
128/**
129 * Sets the value of the national_number field.
130 * @param {number} value The value.
131 */
132i18n.phonenumbers.PhoneNumber.prototype.setNationalNumber = function(value) {
133  this.set$Value(2, value);
134};
135
136
137/**
138 * @return {boolean} Whether the national_number field has a value.
139 */
140i18n.phonenumbers.PhoneNumber.prototype.hasNationalNumber = function() {
141  return this.has$Value(2);
142};
143
144
145/**
146 * @return {number} The number of values in the national_number field.
147 */
148i18n.phonenumbers.PhoneNumber.prototype.nationalNumberCount = function() {
149  return this.count$Values(2);
150};
151
152
153/**
154 * Clears the values in the national_number field.
155 */
156i18n.phonenumbers.PhoneNumber.prototype.clearNationalNumber = function() {
157  this.clear$Field(2);
158};
159
160
161/**
162 * Gets the value of the extension field.
163 * @return {?string} The value.
164 */
165i18n.phonenumbers.PhoneNumber.prototype.getExtension = function() {
166  return /** @type {?string} */ (this.get$Value(3));
167};
168
169
170/**
171 * Gets the value of the extension field or the default value if not set.
172 * @return {string} The value.
173 */
174i18n.phonenumbers.PhoneNumber.prototype.getExtensionOrDefault = function() {
175  return /** @type {string} */ (this.get$ValueOrDefault(3));
176};
177
178
179/**
180 * Sets the value of the extension field.
181 * @param {string} value The value.
182 */
183i18n.phonenumbers.PhoneNumber.prototype.setExtension = function(value) {
184  this.set$Value(3, value);
185};
186
187
188/**
189 * @return {boolean} Whether the extension field has a value.
190 */
191i18n.phonenumbers.PhoneNumber.prototype.hasExtension = function() {
192  return this.has$Value(3);
193};
194
195
196/**
197 * @return {number} The number of values in the extension field.
198 */
199i18n.phonenumbers.PhoneNumber.prototype.extensionCount = function() {
200  return this.count$Values(3);
201};
202
203
204/**
205 * Clears the values in the extension field.
206 */
207i18n.phonenumbers.PhoneNumber.prototype.clearExtension = function() {
208  this.clear$Field(3);
209};
210
211
212/**
213 * Gets the value of the italian_leading_zero field.
214 * @return {?boolean} The value.
215 */
216i18n.phonenumbers.PhoneNumber.prototype.getItalianLeadingZero = function() {
217  return /** @type {?boolean} */ (this.get$Value(4));
218};
219
220
221/**
222 * Gets the value of the italian_leading_zero field or the default value if not set.
223 * @return {boolean} The value.
224 */
225i18n.phonenumbers.PhoneNumber.prototype.getItalianLeadingZeroOrDefault = function() {
226  return /** @type {boolean} */ (this.get$ValueOrDefault(4));
227};
228
229
230/**
231 * Sets the value of the italian_leading_zero field.
232 * @param {boolean} value The value.
233 */
234i18n.phonenumbers.PhoneNumber.prototype.setItalianLeadingZero = function(value) {
235  this.set$Value(4, value);
236};
237
238
239/**
240 * @return {boolean} Whether the italian_leading_zero field has a value.
241 */
242i18n.phonenumbers.PhoneNumber.prototype.hasItalianLeadingZero = function() {
243  return this.has$Value(4);
244};
245
246
247/**
248 * @return {number} The number of values in the italian_leading_zero field.
249 */
250i18n.phonenumbers.PhoneNumber.prototype.italianLeadingZeroCount = function() {
251  return this.count$Values(4);
252};
253
254
255/**
256 * Clears the values in the italian_leading_zero field.
257 */
258i18n.phonenumbers.PhoneNumber.prototype.clearItalianLeadingZero = function() {
259  this.clear$Field(4);
260};
261
262
263/**
264 * Gets the value of the number_of_leading_zeros field.
265 * @return {?number} The value.
266 */
267i18n.phonenumbers.PhoneNumber.prototype.getNumberOfLeadingZeros = function() {
268  return /** @type {?number} */ (this.get$Value(8));
269};
270
271
272/**
273 * Gets the value of the number_of_leading_zeros field or the default value if not set.
274 * @return {number} The value.
275 */
276i18n.phonenumbers.PhoneNumber.prototype.getNumberOfLeadingZerosOrDefault = function() {
277  return /** @type {number} */ (this.get$ValueOrDefault(8));
278};
279
280
281/**
282 * Sets the value of the number_of_leading_zeros field.
283 * @param {number} value The value.
284 */
285i18n.phonenumbers.PhoneNumber.prototype.setNumberOfLeadingZeros = function(value) {
286  this.set$Value(8, value);
287};
288
289
290/**
291 * @return {boolean} Whether the number_of_leading_zeros field has a value.
292 */
293i18n.phonenumbers.PhoneNumber.prototype.hasNumberOfLeadingZeros = function() {
294  return this.has$Value(8);
295};
296
297
298/**
299 * @return {number} The number of values in the number_of_leading_zeros field.
300 */
301i18n.phonenumbers.PhoneNumber.prototype.numberOfLeadingZerosCount = function() {
302  return this.count$Values(8);
303};
304
305
306/**
307 * Clears the values in the number_of_leading_zeros field.
308 */
309i18n.phonenumbers.PhoneNumber.prototype.clearNumberOfLeadingZeros = function() {
310  this.clear$Field(8);
311};
312
313
314/**
315 * Gets the value of the raw_input field.
316 * @return {?string} The value.
317 */
318i18n.phonenumbers.PhoneNumber.prototype.getRawInput = function() {
319  return /** @type {?string} */ (this.get$Value(5));
320};
321
322
323/**
324 * Gets the value of the raw_input field or the default value if not set.
325 * @return {string} The value.
326 */
327i18n.phonenumbers.PhoneNumber.prototype.getRawInputOrDefault = function() {
328  return /** @type {string} */ (this.get$ValueOrDefault(5));
329};
330
331
332/**
333 * Sets the value of the raw_input field.
334 * @param {string} value The value.
335 */
336i18n.phonenumbers.PhoneNumber.prototype.setRawInput = function(value) {
337  this.set$Value(5, value);
338};
339
340
341/**
342 * @return {boolean} Whether the raw_input field has a value.
343 */
344i18n.phonenumbers.PhoneNumber.prototype.hasRawInput = function() {
345  return this.has$Value(5);
346};
347
348
349/**
350 * @return {number} The number of values in the raw_input field.
351 */
352i18n.phonenumbers.PhoneNumber.prototype.rawInputCount = function() {
353  return this.count$Values(5);
354};
355
356
357/**
358 * Clears the values in the raw_input field.
359 */
360i18n.phonenumbers.PhoneNumber.prototype.clearRawInput = function() {
361  this.clear$Field(5);
362};
363
364
365/**
366 * Gets the value of the country_code_source field.
367 * @return {?i18n.phonenumbers.PhoneNumber.CountryCodeSource} The value.
368 */
369i18n.phonenumbers.PhoneNumber.prototype.getCountryCodeSource = function() {
370  return /** @type {?i18n.phonenumbers.PhoneNumber.CountryCodeSource} */ (this.get$Value(6));
371};
372
373
374/**
375 * Gets the value of the country_code_source field or the default value if not set.
376 * @return {!i18n.phonenumbers.PhoneNumber.CountryCodeSource} The value.
377 */
378i18n.phonenumbers.PhoneNumber.prototype.getCountryCodeSourceOrDefault = function() {
379  return /** @type {!i18n.phonenumbers.PhoneNumber.CountryCodeSource} */ (this.get$ValueOrDefault(6));
380};
381
382
383/**
384 * Sets the value of the country_code_source field.
385 * @param {!i18n.phonenumbers.PhoneNumber.CountryCodeSource} value The value.
386 */
387i18n.phonenumbers.PhoneNumber.prototype.setCountryCodeSource = function(value) {
388  this.set$Value(6, value);
389};
390
391
392/**
393 * @return {boolean} Whether the country_code_source field has a value.
394 */
395i18n.phonenumbers.PhoneNumber.prototype.hasCountryCodeSource = function() {
396  return this.has$Value(6);
397};
398
399
400/**
401 * @return {number} The number of values in the country_code_source field.
402 */
403i18n.phonenumbers.PhoneNumber.prototype.countryCodeSourceCount = function() {
404  return this.count$Values(6);
405};
406
407
408/**
409 * Clears the values in the country_code_source field.
410 */
411i18n.phonenumbers.PhoneNumber.prototype.clearCountryCodeSource = function() {
412  this.clear$Field(6);
413};
414
415
416/**
417 * Gets the value of the preferred_domestic_carrier_code field.
418 * @return {?string} The value.
419 */
420i18n.phonenumbers.PhoneNumber.prototype.getPreferredDomesticCarrierCode = function() {
421  return /** @type {?string} */ (this.get$Value(7));
422};
423
424
425/**
426 * Gets the value of the preferred_domestic_carrier_code field or the default value if not set.
427 * @return {string} The value.
428 */
429i18n.phonenumbers.PhoneNumber.prototype.getPreferredDomesticCarrierCodeOrDefault = function() {
430  return /** @type {string} */ (this.get$ValueOrDefault(7));
431};
432
433
434/**
435 * Sets the value of the preferred_domestic_carrier_code field.
436 * @param {string} value The value.
437 */
438i18n.phonenumbers.PhoneNumber.prototype.setPreferredDomesticCarrierCode = function(value) {
439  this.set$Value(7, value);
440};
441
442
443/**
444 * @return {boolean} Whether the preferred_domestic_carrier_code field has a value.
445 */
446i18n.phonenumbers.PhoneNumber.prototype.hasPreferredDomesticCarrierCode = function() {
447  return this.has$Value(7);
448};
449
450
451/**
452 * @return {number} The number of values in the preferred_domestic_carrier_code field.
453 */
454i18n.phonenumbers.PhoneNumber.prototype.preferredDomesticCarrierCodeCount = function() {
455  return this.count$Values(7);
456};
457
458
459/**
460 * Clears the values in the preferred_domestic_carrier_code field.
461 */
462i18n.phonenumbers.PhoneNumber.prototype.clearPreferredDomesticCarrierCode = function() {
463  this.clear$Field(7);
464};
465
466
467/**
468 * Enumeration CountryCodeSource.
469 * @enum {number}
470 */
471i18n.phonenumbers.PhoneNumber.CountryCodeSource = {
472  UNSPECIFIED: 0,
473  FROM_NUMBER_WITH_PLUS_SIGN: 1,
474  FROM_NUMBER_WITH_IDD: 5,
475  FROM_NUMBER_WITHOUT_PLUS_SIGN: 10,
476  FROM_DEFAULT_COUNTRY: 20
477};
478
479
480/** @override */
481i18n.phonenumbers.PhoneNumber.prototype.getDescriptor = function() {
482  var descriptor = i18n.phonenumbers.PhoneNumber.descriptor_;
483  if (!descriptor) {
484    // The descriptor is created lazily when we instantiate a new instance.
485    var descriptorObj = {
486      0: {
487        name: 'PhoneNumber',
488        fullName: 'i18n.phonenumbers.PhoneNumber'
489      },
490      1: {
491        name: 'country_code',
492        required: true,
493        fieldType: goog.proto2.Message.FieldType.INT32,
494        type: Number
495      },
496      2: {
497        name: 'national_number',
498        required: true,
499        fieldType: goog.proto2.Message.FieldType.UINT64,
500        type: Number
501      },
502      3: {
503        name: 'extension',
504        fieldType: goog.proto2.Message.FieldType.STRING,
505        type: String
506      },
507      4: {
508        name: 'italian_leading_zero',
509        fieldType: goog.proto2.Message.FieldType.BOOL,
510        type: Boolean
511      },
512      8: {
513        name: 'number_of_leading_zeros',
514        fieldType: goog.proto2.Message.FieldType.INT32,
515        defaultValue: 1,
516        type: Number
517      },
518      5: {
519        name: 'raw_input',
520        fieldType: goog.proto2.Message.FieldType.STRING,
521        type: String
522      },
523      6: {
524        name: 'country_code_source',
525        fieldType: goog.proto2.Message.FieldType.ENUM,
526        defaultValue: i18n.phonenumbers.PhoneNumber.CountryCodeSource.UNSPECIFIED,
527        type: i18n.phonenumbers.PhoneNumber.CountryCodeSource
528      },
529      7: {
530        name: 'preferred_domestic_carrier_code',
531        fieldType: goog.proto2.Message.FieldType.STRING,
532        type: String
533      }
534    };
535    i18n.phonenumbers.PhoneNumber.descriptor_ = descriptor =
536        goog.proto2.Message.createDescriptor(
537             i18n.phonenumbers.PhoneNumber, descriptorObj);
538  }
539  return descriptor;
540};
541
542
543// Export getDescriptor static function robust to minification.
544i18n.phonenumbers.PhoneNumber['ctor'] = i18n.phonenumbers.PhoneNumber;
545i18n.phonenumbers.PhoneNumber['ctor'].getDescriptor =
546    i18n.phonenumbers.PhoneNumber.prototype.getDescriptor;
547