@Override public String formatValueSynchron(final String pvalue) { return IsbnUtil.isbn13Format(pvalue); }
/** * format isbn10 or 13 with separator signs. * * @param pstring string to format * @return formated string */ public static String isbnFormat(final String pstring) { if (pstring == null) { return null; } final int length = isbnCompress(pstring).length(); if (length > Isbn10Validator.ISBN10_LENGTH) { return isbn13Format(pstring); } else { return isbn10Format(pstring); } }
/** * format isbn10 or 13 with separator signs. * * @param pstring string to format * @return formated string */ public static String isbnFormat(final String pstring) { if (pstring == null) { return null; } final int length = isbnCompress(pstring).length(); if (length > Isbn10Validator.ISBN10_LENGTH) { return isbn13Format(pstring); } else { return isbn10Format(pstring); } }
/** * test formating isbn13. */ @Test public void testIsbn13Format() { Assert.assertNull("isbn format should be null", IsbnUtil.isbn13Format(null)); for (final Entry<String, String> entry : IsbnUtilTestCases.getIsbn13FormatCases().entrySet()) { Assert.assertEquals("isbn format failed", entry.getKey(), IsbnUtil.isbn13Format(entry.getValue())); } }
/** * test formating isbn13. */ @Test public void testIsbn13Format() { Assert.assertNull("isbn format should be null", IsbnUtil.isbn13Format(null)); for (final Entry<String, String> entry : IsbnUtilTestCases.getIsbn13FormatCases().entrySet()) { Assert.assertEquals("isbn format failed", entry.getKey(), IsbnUtil.isbn13Format(entry.getValue())); } }