public final ValueWithPos<String> formatDin5008WithPos(
      final ValueWithPos<PhoneNumberData> pphoneNumberData, final PhoneCountryData pcountryData) {
    if (pphoneNumberData != null && pcountryData != null
        && StringUtils.equals(pcountryData.getCountryCodeData().getCountryCode(),
            pphoneNumberData.getValue().getCountryCode())) {
      return this.formatDin5008NationalWithPos(pphoneNumberData);
    } else {
      return this.formatDin5008InternationalWithPos(pphoneNumberData);
    }
  }
public final ValueWithPos < String > formatDin5008WithPos ( final ValueWithPos < PhoneNumberData > pphoneNumberData , final PhoneCountryData pcountryData ) { if ( pphoneNumberData != null && pcountryData != null && StringUtils . equals ( pcountryData . getCountryCodeData ( ) . getCountryCode ( ) , pphoneNumberData . getValue ( ) . getCountryCode ( ) ) ) { return this . formatDin5008NationalWithPos ( pphoneNumberData ) ; } else { return this . formatDin5008InternationalWithPos ( pphoneNumberData ) ; } }
format phone number in DIN 5008 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