@GET @Path(PhoneNumber.FORMAT_RFC3966) public String formatRfc3966(@QueryParam(Parameters.LANGUAGE) final String planguage, @QueryParam(Parameters.COUNTRY) final String pcountry, @QueryParam(Parameters.PHONE_NUMBER) final String pphoneNumber) { return phoneNumberUtil.formatRfc3966(pphoneNumber, pcountry); }
/** * format phone number in RFC 3966 format. * * @param pphoneNumber phone number to format * @param pcountryCode iso code of country * @return formated phone number as String */ public final String formatRfc3966(final String pphoneNumber, final String pcountryCode) { return this.formatRfc3966(this.parsePhoneNumber(pphoneNumber, pcountryCode)); }
@RequestMapping(value = PhoneNumber.FORMAT_RFC3966, method = RequestMethod.GET) @PermitAll public String formatRfc3966( @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.formatRfc3966(pphoneNumber, pcountry); }
/** * format phone number in RFC 3966 format. * * @param pphoneNumber phone number as String to format * @return formated phone number as String */ public final String formatRfc3966(final String pphoneNumber) { return this.formatRfc3966(this.parsePhoneNumber(pphoneNumber)); }
/** * format phone number in RFC 3966 format. * * @param pphoneNumber phone number as String to format * @return formated phone number as String */ public final String formatRfc3966(final String pphoneNumber) { return this.formatRfc3966(this.parsePhoneNumber(pphoneNumber)); }
@RequestMapping(value = PhoneNumber.FORMAT_RFC3966, method = RequestMethod.GET) @PermitAll public String formatRfc3966( @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.formatRfc3966(pphoneNumber, pcountry); }
/** * format phone number in RFC 3966 format. * * @param pphoneNumber phone number to format * @param pcountryCode iso code of country * @return formated phone number as String */ public final String formatRfc3966(final String pphoneNumber, final String pcountryCode) { return this.formatRfc3966(this.parsePhoneNumber(pphoneNumber, pcountryCode)); }
/** * test formating phone number in RFC 3966 format. */ @Test public void testFormatRfc3966() { Assert.assertNull("Should be null", this.phoneNumberUtil.formatRfc3966((PhoneNumberData) null)); for (final Entry<PhoneNumberInterface, String> testCase : PhoneNumberUtilTestCases .getFormatRfc3966Cases().entrySet()) { final String formatedNumber = this.phoneNumberUtil.formatRfc3966(testCase.getKey()); Assert.assertEquals("Formating RFC 3966 " + testCase.getKey().toString(), testCase.getValue(), formatedNumber); } }
/** * test formating phone number in RFC 3966 format. */ @Test public void testFormatRfc3966() { Assert.assertNull("Should be null", this.phoneNumberUtil.formatRfc3966((PhoneNumberData) null)); for (final Entry<PhoneNumberInterface, String> testCase : PhoneNumberUtilTestCases .getFormatRfc3966Cases().entrySet()) { final String formatedNumber = this.phoneNumberUtil.formatRfc3966(testCase.getKey()); Assert.assertEquals("Formating RFC 3966 " + testCase.getKey().toString(), testCase.getValue(), formatedNumber); } }
/** * test formating phone number in RFC 3966 format with cursor position. */ @Test public void testFormatRfc3966WithPos() { Assert.assertNull("Should be null", this.phoneNumberUtil.formatRfc3966((ValueWithPos<String>) null)); for (final Entry<ValueWithPos<String>, ValueWithPos<String>> testCase : PhoneNumberUtilTestCases .getFormatRfc3966WithPosCases().entrySet()) { final ValueWithPos<String> formatedNumber = this.phoneNumberUtil.formatRfc3966(testCase.getKey()); Assert.assertEquals("Formating Rfc3966 " + testCase.getKey().toString(), testCase.getValue(), formatedNumber); } }
/** * test formating phone number in RFC 3966 format with cursor position. */ @Test public void testFormatRfc3966WithPos() { Assert.assertNull("Should be null", this.phoneNumberUtil.formatRfc3966((ValueWithPos<String>) null)); for (final Entry<ValueWithPos<String>, ValueWithPos<String>> testCase : PhoneNumberUtilTestCases .getFormatRfc3966WithPosCases().entrySet()) { final ValueWithPos<String> formatedNumber = this.phoneNumberUtil.formatRfc3966(testCase.getKey()); Assert.assertEquals("Formating Rfc3966 " + testCase.getKey().toString(), testCase.getValue(), formatedNumber); } }