@Override public void formatValue(final ValueWithPos<String> pvalue, final boolean fireEvents) { setTextWithPos(IbanUtil.ibanFormatWithPos(pvalue), fireEvents); }
@Override public void formatValue(final ValueWithPos<String> pvalue) { setTextWithPos(IbanUtil.ibanFormatWithPos(pvalue)); }
/** * format iban to four character blocks. * * @param pstring string to format * @return formated string */ public static String ibanFormat(final String pstring) { if (pstring == null) { return null; } final ValueWithPos<String> formatedValue = ibanFormatWithPos(new ValueWithPos<>(pstring, -1)); return formatedValue.getValue(); }
/** * format iban to four character blocks. * * @param pstring string to format * @return formated string */ public static String ibanFormat(final String pstring) { if (pstring == null) { return null; } final ValueWithPos<String> formatedValue = ibanFormatWithPos(new ValueWithPos<>(pstring, -1)); return formatedValue.getValue(); }
/** * test formating iban with position. */ @Test public void testIbanFormatWithPos() { Assert.assertNull("iban format should be null", IbanUtil.ibanFormatWithPos(null)); for (final Entry<ValueWithPos<String>, ValueWithPos<String>> entry : IbanUtilTestCases .getFormatWithPosCases().entrySet()) { Assert.assertEquals("iban format failed", entry.getKey(), IbanUtil.ibanFormatWithPos(entry.getValue())); } }
/** * test formating iban with position. */ @Test public void testIbanFormatWithPos() { Assert.assertNull("iban format should be null", IbanUtil.ibanFormatWithPos(null)); for (final Entry<ValueWithPos<String>, ValueWithPos<String>> entry : IbanUtilTestCases .getFormatWithPosCases().entrySet()) { Assert.assertEquals("iban format failed", entry.getKey(), IbanUtil.ibanFormatWithPos(entry.getValue())); } }
/** * test formating iban. */ @Test public void testIbanFormat() { Assert.assertNull("iban format should be null", IbanUtil.ibanFormatWithPos(null)); for (final Entry<String, String> entry : IbanUtilTestCases.getFormatCases().entrySet()) { Assert.assertEquals("iban format failed", entry.getKey(), IbanUtil.ibanFormat(entry.getValue())); } }
/** * test formating iban. */ @Test public void testIbanFormat() { Assert.assertNull("iban format should be null", IbanUtil.ibanFormatWithPos(null)); for (final Entry<String, String> entry : IbanUtilTestCases.getFormatCases().entrySet()) { Assert.assertEquals("iban format failed", entry.getKey(), IbanUtil.ibanFormat(entry.getValue())); } }