Home
last modified time | relevance | path

Searched refs:phoneUtil (Results 1 – 14 of 14) sorted by relevance

/third_party/libphonenumber/java/libphonenumber/test/com/google/i18n/phonenumbers/
DPhoneNumberUtilTest.java134 assertTrue(phoneUtil.getSupportedRegions().size() > 0); in testGetSupportedRegions()
139 phoneUtil.getSupportedGlobalNetworkCallingCodes(); in testGetSupportedGlobalNetworkCallingCodes()
143 assertEquals(RegionCode.UN001, phoneUtil.getRegionCodeForCountryCode(callingCode)); in testGetSupportedGlobalNetworkCallingCodes()
148 Set<Integer> callingCodes = phoneUtil.getSupportedCallingCodes(); in testGetSupportedCallingCodes()
152 assertTrue(phoneUtil.getRegionCodeForCountryCode(callingCode) != RegionCode.ZZ); in testGetSupportedCallingCodes()
155 assertTrue(callingCodes.size() > phoneUtil.getSupportedGlobalNetworkCallingCodes().size()); in testGetSupportedCallingCodes()
161 assertNull(phoneUtil.getMetadataForRegion("No Such Region")); in testGetInstanceLoadBadMetadata()
162 assertNull(phoneUtil.getMetadataForNonGeographicalRegion(-1)); in testGetInstanceLoadBadMetadata()
166 assertTrue(phoneUtil.getSupportedTypesForRegion(RegionCode.BR) in testGetSupportedTypesForRegion()
169 assertFalse(phoneUtil.getSupportedTypesForRegion(RegionCode.BR) in testGetSupportedTypesForRegion()
[all …]
DPhoneNumberMatcherTest.java251 phoneUtil.findNumbers(text, RegionCode.US).iterator(); in testFourMatchesInARow()
271 phoneUtil.findNumbers(text, RegionCode.US).iterator(); in testMatchesFoundWithMultipleSpaces()
284 phoneUtil.findNumbers(zipPreceding, RegionCode.US).iterator(); in testMatchWithSurroundingZipcodes()
292 iterator = phoneUtil.findNumbers(zipFollowing, RegionCode.US).iterator(); in testMatchWithSurroundingZipcodes()
404 number1.setCountryCode(phoneUtil.getCountryCodeForRegion(region)); in testMatchesMultiplePhoneNumbersSeparatedByPhoneNumberPunctuation()
409 number2.setCountryCode(phoneUtil.getCountryCodeForRegion(region)); in testMatchesMultiplePhoneNumbersSeparatedByPhoneNumberPunctuation()
413 Iterator<PhoneNumberMatch> matches = phoneUtil.findNumbers(text, region).iterator(); in testMatchesMultiplePhoneNumbersSeparatedByPhoneNumberPunctuation()
423 assertTrue(hasNoMatches(phoneUtil.findNumbers(text, region))); in testDoesNotMatchMultiplePhoneNumbersSeparatedWithNoWhiteSpace()
654 hasNoMatches(phoneUtil.findNumbers(text, region))); in findMatchesInContexts()
663 hasNoMatches(phoneUtil.findNumbers(text, region, Leniency.POSSIBLE, in findMatchesInContexts()
[all …]
DAsYouTypeFormatterTest.java30 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.ZZ); in testInvalidRegion()
52 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.ZZ); in testInvalidPlusSign()
72 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.ZZ); in testTooLongNumberMatchingMultipleLeadingDigits()
92 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.BY); in testCountryWithSpaceInNationalPrefixFormattingRule()
107 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.BY); in testCountryWithSpaceInNationalPrefixFormattingRuleAndLongNdd()
121 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.US); in testAYTFUS()
215 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.US); in testAYTFUSFullWidthCharacters()
229 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.US); in testAYTFUSMobileShortCode()
238 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.US); in testAYTFUSVanityNumber()
254 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter(RegionCode.US); in testAYTFAndRememberPositionUS()
[all …]
DTestMetadataTestCase.java46 protected final PhoneNumberUtil phoneUtil; field in TestMetadataTestCase
49 phoneUtil = new PhoneNumberUtil( in TestMetadataTestCase()
59 PhoneNumberUtil.setInstance(phoneUtil); in setUp()
DShortNumberInfoTest.java367 return phoneUtil.parse(number, regionCode); in parse()
/third_party/libphonenumber/javascript/i18n/phonenumbers/
Dphonenumberutil_test.js44 var phoneUtil = i18n.phonenumbers.PhoneNumberUtil.getInstance(); variable
267 var metadata = phoneUtil.getMetadataForRegion(RegionCode.US);
291 var metadata = phoneUtil.getMetadataForRegion(RegionCode.DE);
313 var metadata = phoneUtil.getMetadataForRegion(RegionCode.AR);
332 var metadata = phoneUtil.getMetadataForNonGeographicalRegion(800);
344 assertFalse(phoneUtil.isNumberGeographical(BS_MOBILE));
346 assertTrue(phoneUtil.isNumberGeographical(AU_NUMBER));
348 assertFalse(phoneUtil.isNumberGeographical(INTERNATIONAL_TOLL_FREE));
352 assertTrue(phoneUtil.isNumberGeographical(AR_MOBILE));
354 assertTrue(phoneUtil.isNumberGeographical(MX_MOBILE1));
[all …]
Dshortnumberinfo_test.js43 var phoneUtil = i18n.phonenumbers.PhoneNumberUtil.getInstance(); variable
53 phoneUtil.parse('123456', RegionCode.FR), RegionCode.FR));
74 phoneUtil.parse('1010', RegionCode.FR), RegionCode.FR));
80 phoneUtil.parse('123456', RegionCode.FR), RegionCode.FR));
95 phoneUtil.parse('33669', RegionCode.US), RegionCode.US));
102 phoneUtil.parse('911', RegionCode.US), RegionCode.US));
131 phoneUtil.parse(premiumRateExample, RegionCode.FR), RegionCode.FR));
145 phoneUtil.parse(standardRateExample, RegionCode.FR), RegionCode.FR));
159 phoneUtil.parse(tollFreeExample, RegionCode.FR), RegionCode.FR));
170 phoneUtil.parse('12345', RegionCode.FR), RegionCode.FR));
[all …]
/third_party/libphonenumber/java/geocoder/src/com/google/i18n/phonenumbers/geocoding/
DPhoneNumberOfflineGeocoder.java38 private final PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); field in PhoneNumberOfflineGeocoder
68 phoneUtil.getRegionCodesForCountryCode(number.getCountryCode()); in getCountryNameForNumber()
74 if (phoneUtil.isValidNumberForRegion(number, regionCode)) { in getCountryNameForNumber()
119 String nationalNumber = phoneUtil.getNationalSignificantNumber(number); in getDescriptionForValidNumber()
124 String region = phoneUtil.getRegionCodeForCountryCode(number.getCountryCode()); in getDescriptionForValidNumber()
127 copiedNumber = phoneUtil.parse(nationalNumber, region); in getDescriptionForValidNumber()
169 String regionCode = phoneUtil.getRegionCodeForNumber(number); in getDescriptionForValidNumber()
189 PhoneNumberType numberType = phoneUtil.getNumberType(number); in getDescriptionForNumber()
192 } else if (!phoneUtil.isNumberGeographical(numberType, number.getCountryCode())) { in getDescriptionForNumber()
212 PhoneNumberType numberType = phoneUtil.getNumberType(number); in getDescriptionForNumber()
[all …]
/third_party/libphonenumber/java/demo/src/com/google/phonenumbers/
DPhoneNumberParserServlet.java60 private PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); field in PhoneNumberParserServlet
161 PhoneNumber number = phoneUtil.parseAndKeepRawInput(numberStr, defaultCountry); in getOutputForFile()
162 boolean isNumberValid = phoneUtil.isValidNumber(number); in getOutputForFile()
164 isNumberValid ? phoneUtil.formatInOriginalFormat(number, defaultCountry) : "invalid"; in getOutputForFile()
166 isNumberValid ? phoneUtil.format(number, PhoneNumberFormat.INTERNATIONAL) : "invalid"; in getOutputForFile()
262 PhoneNumber number = phoneUtil.parseAndKeepRawInput(phoneNumber, defaultCountry); in getOutputForSingleNumber()
276 boolean isPossible = phoneUtil.isPossibleNumber(number); in getOutputForSingleNumber()
277 boolean isNumberValid = phoneUtil.isValidNumber(number); in getOutputForSingleNumber()
278 PhoneNumberType numberType = phoneUtil.getNumberType(number); in getOutputForSingleNumber()
286 if (phoneUtil.isPossibleNumberWithReason(number) in getOutputForSingleNumber()
[all …]
/third_party/libphonenumber/java/carrier/src/com/google/i18n/phonenumbers/
DPhoneNumberToCarrierMapper.java34 private final PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); field in PhoneNumberToCarrierMapper
90 PhoneNumberType numberType = phoneUtil.getNumberType(number); in getNameForNumber()
108 if (phoneUtil.isMobileNumberPortableRegion(phoneUtil.getRegionCodeForNumber(number))) { in getSafeDisplayName()
/third_party/libphonenumber/java/libphonenumber/src/com/google/i18n/phonenumbers/
DAsYouTypeFormatter.java58 private final PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); field in AsYouTypeFormatter
128 int countryCallingCode = phoneUtil.getCountryCodeForRegion(regionCode); in getMetadataForRegion()
129 String mainCountry = phoneUtil.getRegionCodeForCountryCode(countryCallingCode); in getMetadataForRegion()
130 PhoneMetadata metadata = phoneUtil.getMetadataForRegion(mainCountry); in getMetadataForRegion()
607 int countryCode = phoneUtil.extractCountryCode(nationalNumber, numberWithoutCountryCallingCode); in attemptToExtractCountryCallingCode()
613 String newRegionCode = phoneUtil.getRegionCodeForCountryCode(countryCode); in attemptToExtractCountryCallingCode()
615 currentMetadata = phoneUtil.getMetadataForNonGeographicalRegion(countryCode); in attemptToExtractCountryCallingCode()
DPhoneNumberMatcher.java191 private final PhoneNumberUtil phoneUtil; field in PhoneNumberMatcher
241 this.phoneUtil = util; in PhoneNumberMatcher()
421 PhoneNumber number = phoneUtil.parseAndKeepRawInput(candidate, preferredRegion); in parseAndVerify()
423 if (leniency.verify(number, candidate, phoneUtil, this)) { in parseAndVerify()
/third_party/libphonenumber/
DREADME.md125 PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
127 PhoneNumber swissNumberProto = phoneUtil.parse(swissNumberStr, "CH");
149 boolean isValid = phoneUtil.isValidNumber(swissNumberProto); // returns true
157 System.out.println(phoneUtil.format(swissNumberProto, PhoneNumberFormat.INTERNATIONAL));
159 System.out.println(phoneUtil.format(swissNumberProto, PhoneNumberFormat.NATIONAL));
161 System.out.println(phoneUtil.format(swissNumberProto, PhoneNumberFormat.E164));
169 System.out.println(phoneUtil.formatOutOfCountryCallingNumber(swissNumberProto, "US"));
175 PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
176 AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter("US");
/third_party/libphonenumber/java/internal/prefixmapper/src/com/google/i18n/phonenumbers/prefixmapper/
DPhonePrefixMap.java39 private final PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance(); field in PhonePrefixMap
182 Long.parseLong(number.getCountryCode() + phoneUtil.getNationalSignificantNumber(number)); in lookup()