/** * format phone number in E123 format. * * @param pphoneNumberData phone number to format * @return formated phone number as String */ public final String formatE123(final PhoneNumberInterface pphoneNumberData) { return this.formatE123(pphoneNumberData, defaultCountryData); }
/** * format phone number in E123 format. * * @param pphoneNumberData phone number to format * @return formated phone number as String */ public final String formatE123(final PhoneNumberInterface pphoneNumberData) { return this.formatE123(pphoneNumberData, defaultCountryData); }
@GET @Path(PhoneNumber.FORMAT_E123) public String formatE123(@QueryParam(Parameters.LANGUAGE) final String planguage, @QueryParam(Parameters.COUNTRY) final String pcountry, @QueryParam(Parameters.PHONE_NUMBER) final String pphoneNumber) { return phoneNumberUtil.formatE123(pphoneNumber, pcountry); }
@RequestMapping(value = PhoneNumber.FORMAT_E123, method = RequestMethod.GET) @PermitAll public String formatE123( @RequestParam(value = Parameters.LANGUAGE, required = true) final String planguage, @RequestParam(value = Parameters.COUNTRY, required = true) final String pcountry, @RequestParam(value = Parameters.PHONE_NUMBER, required = true) final String pphoneNumber) { return phoneNumberUtil.formatE123(pphoneNumber, pcountry); }
/** * format phone number in E123 format. * * @param pphoneNumber phone number as String to format * @return formated phone number as String */ public final String formatE123(final String pphoneNumber) { return this.formatE123(this.parsePhoneNumber(pphoneNumber), defaultCountryData); }
@RequestMapping(value = PhoneNumber.FORMAT_E123, method = RequestMethod.GET) @PermitAll public String formatE123( @RequestParam(value = Parameters.LANGUAGE, required = true) final String planguage, @RequestParam(value = Parameters.COUNTRY, required = true) final String pcountry, @RequestParam(value = Parameters.PHONE_NUMBER, required = true) final String pphoneNumber) { return phoneNumberUtil.formatE123(pphoneNumber, pcountry); }
/** * format phone number in E123 format. * * @param pphoneNumber phone number as String to format * @return formated phone number as String */ public final String formatE123(final String pphoneNumber) { return this.formatE123(this.parsePhoneNumber(pphoneNumber), defaultCountryData); }
@Override public String formatValueSynchron(final String pvalue) { final String formatedNumber = phoneNumberUtil.formatE123(pvalue, StringUtils.upperCase(Objects.toString(countryCodeField.getValue(), null))); if (StringUtils.startsWith(pvalue, formatedNumber)) { return pvalue; } return StringUtils.defaultString(formatedNumber, pvalue); }
/** * format phone number in E123 format. * * @param pphoneNumberData phone number to format * @param pcountryCode iso code of country * @return formated phone number as String */ public final String formatE123(final PhoneNumberInterface pphoneNumberData, final String pcountryCode) { return this.formatE123(pphoneNumberData, CreatePhoneCountryConstantsClass.create().countryMap() .get(StringUtils.defaultString(pcountryCode))); }
/** * format phone number in E123 format. * * @param pphoneNumberData phone number to format * @param pcountryCode iso code of country * @return formated phone number as String */ public final String formatE123(final PhoneNumberInterface pphoneNumberData, final String pcountryCode) { return this.formatE123(pphoneNumberData, CreatePhoneCountryConstantsClass.create().countryMap() .get(StringUtils.defaultString(pcountryCode))); }
/** * format phone number in E123 format. * * @param pphoneNumber phone number as String to format * @param pcountryCode iso code of country * @return formated phone number as String */ public final String formatE123(final String pphoneNumber, final String pcountryCode) { return this.formatE123(this.parsePhoneNumber(pphoneNumber), CreatePhoneCountryConstantsClass .create().countryMap().get(StringUtils.defaultString(pcountryCode))); }
/** * format phone number in E123 format. * * @param pphoneNumber phone number as String to format * @param pcountryCode iso code of country * @return formated phone number as String */ public final String formatE123(final String pphoneNumber, final String pcountryCode) { return this.formatE123(this.parsePhoneNumber(pphoneNumber), CreatePhoneCountryConstantsClass .create().countryMap().get(StringUtils.defaultString(pcountryCode))); }
/** * test formating phone number in E123 format. */ @Test public void testFormatE123() { Assert.assertNull("Should be null", this.phoneNumberUtil.formatE123((PhoneNumberData) null)); for (final Entry<PhoneNumberInterface, String> testCase : PhoneNumberUtilTestCases .getFormatE123Cases().entrySet()) { final String formatedNumber = this.phoneNumberUtil.formatE123(testCase.getKey()); Assert.assertEquals("Formating E123 " + testCase.getKey().toString(), testCase.getValue(), formatedNumber); } }
/** * test formating phone number in E123 format. */ @Test public void testFormatE123() { Assert.assertNull("Should be null", this.phoneNumberUtil.formatE123((PhoneNumberData) null)); for (final Entry<PhoneNumberInterface, String> testCase : PhoneNumberUtilTestCases .getFormatE123Cases().entrySet()) { final String formatedNumber = this.phoneNumberUtil.formatE123(testCase.getKey()); Assert.assertEquals("Formating E123 " + testCase.getKey().toString(), testCase.getValue(), formatedNumber); } }
/** * test formating phone number in E123 format with cursor position. */ @Test public void testFormatE123WithPos() { Assert.assertNull("Should be null", this.phoneNumberUtil.formatE123((ValueWithPos<String>) null)); for (final Entry<ValueWithPos<String>, ValueWithPos<String>> testCase : PhoneNumberUtilTestCases .getFormatE123WithPosCases().entrySet()) { final ValueWithPos<String> formatedNumber = this.phoneNumberUtil.formatE123(testCase.getKey()); Assert.assertEquals("Formating E123 " + testCase.getKey().toString(), testCase.getValue(), formatedNumber); } }
/** * test formating phone number in E123 format with cursor position. */ @Test public void testFormatE123WithPos() { Assert.assertNull("Should be null", this.phoneNumberUtil.formatE123((ValueWithPos<String>) null)); for (final Entry<ValueWithPos<String>, ValueWithPos<String>> testCase : PhoneNumberUtilTestCases .getFormatE123WithPosCases().entrySet()) { final ValueWithPos<String> formatedNumber = this.phoneNumberUtil.formatE123(testCase.getKey()); Assert.assertEquals("Formating E123 " + testCase.getKey().toString(), testCase.getValue(), formatedNumber); } }