google-libphonenumber 1.0.26 → 1.1.2

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