@PUT @Path(PhoneNumber.FORMAT_COMMON_INTERNATIONAL_WITH_POS) public ValueWithPos<String> formatCommonInternationalWithPos( final ValueWithPosAndCountry<String> pphoneNumber) { return phoneNumberUtil.formatCommonInternationalWithPos(pphoneNumber, pphoneNumber.getCountry()); }
@RequestMapping(value = PhoneNumber.FORMAT_COMMON_INTERNATIONAL_WITH_POS, method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) @PermitAll @ResponseBody public ValueWithPos<String> formatCommonInternationalWithPos( @RequestBody final ValueWithPosAndCountry<String> pphoneNumber) { return phoneNumberUtil.formatCommonInternationalWithPos(pphoneNumber, pphoneNumber.getCountry()); }
@RequestMapping(value = PhoneNumber.FORMAT_COMMON_INTERNATIONAL_WITH_POS, method = RequestMethod.PUT) @ResponseStatus(HttpStatus.OK) @PermitAll @ResponseBody public ValueWithPos<String> formatCommonInternationalWithPos( @RequestBody final ValueWithPosAndCountry<String> pphoneNumber) { return phoneNumberUtil.formatCommonInternationalWithPos(pphoneNumber, pphoneNumber.getCountry()); }
/** * format phone number in common international format with cursor position handling. * * @param pphoneNumber phone number as String to format with cursor position * @param pcountryCode iso code of country * @return formated phone number as String with new cursor position */ public final ValueWithPos<String> formatCommonInternationalWithPos( final ValueWithPos<String> pphoneNumber, final String pcountryCode) { return valueWithPosDefaults( this.formatCommonInternationalWithPos(this.parsePhoneNumber(pphoneNumber, pcountryCode)), pphoneNumber); }
/** * format phone number in common international format with cursor position handling. * * @param pphoneNumber phone number as String to format with cursor position * @param pcountryCode iso code of country * @return formated phone number as String with new cursor position */ public final ValueWithPos<String> formatCommonInternationalWithPos( final ValueWithPos<String> pphoneNumber, final String pcountryCode) { return valueWithPosDefaults( this.formatCommonInternationalWithPos(this.parsePhoneNumber(pphoneNumber, pcountryCode)), pphoneNumber); }
/** * format phone number in common international format with cursor position handling. * * @param pphoneNumber phone number as String to format with cursor position * @return formated phone number as String with new cursor position */ public final ValueWithPos<String> formatCommonInternational( final ValueWithPos<String> pphoneNumber) { return valueWithPosDefaults( this.formatCommonInternationalWithPos(this.parsePhoneNumber(pphoneNumber)), pphoneNumber); }
/** * format phone number in common international format with cursor position handling. * * @param pphoneNumber phone number as String to format with cursor position * @return formated phone number as String with new cursor position */ public final ValueWithPos<String> formatCommonInternational( final ValueWithPos<String> pphoneNumber) { return valueWithPosDefaults( this.formatCommonInternationalWithPos(this.parsePhoneNumber(pphoneNumber)), pphoneNumber); }
@Override public void formatValue(final ValueWithPos<String> pvalue, final boolean fireEvents) { setTextWithPos( phoneNumberUtil.formatCommonInternationalWithPos(pvalue, StringUtils.upperCase(Objects.toString(countryCodeField.getValue(), null))), fireEvents); }
@Override public void formatValue(final ValueWithPos<String> pvalue) { setTextWithPos(phoneNumberUtil.formatCommonInternationalWithPos(pvalue, StringUtils.upperCase(Objects.toString(countryCodeField.getValue())))); }
/** * format phone number in common format with cursor position handling. * * @param pphoneNumberData phone number to format with cursor position * @param pcountryData country data * @return formated phone number as String with new cursor position */ public final ValueWithPos<String> formatCommonWithPos( final ValueWithPos<PhoneNumberData> pphoneNumberData, final PhoneCountryData pcountryData) { if (pphoneNumberData != null && pcountryData != null && StringUtils.equals(pcountryData.getCountryCodeData().getCountryCode(), pphoneNumberData.getValue().getCountryCode())) { return this.formatCommonNationalWithPos(pphoneNumberData); } else { return this.formatCommonInternationalWithPos(pphoneNumberData); } }
/** * format phone number in common format with cursor position handling. * * @param pphoneNumberData phone number to format with cursor position * @param pcountryData country data * @return formated phone number as String with new cursor position */ public final ValueWithPos<String> formatCommonWithPos( final ValueWithPos<PhoneNumberData> pphoneNumberData, final PhoneCountryData pcountryData) { if (pphoneNumberData != null && pcountryData != null && StringUtils.equals(pcountryData.getCountryCodeData().getCountryCode(), pphoneNumberData.getValue().getCountryCode())) { return this.formatCommonNationalWithPos(pphoneNumberData); } else { return this.formatCommonInternationalWithPos(pphoneNumberData); } }