diff --git a/src/main/java/org/iban4j/bban/BbanStructure.java b/src/main/java/org/iban4j/bban/BbanStructure.java index 92fd314..ca3d91f 100644 --- a/src/main/java/org/iban4j/bban/BbanStructure.java +++ b/src/main/java/org/iban4j/bban/BbanStructure.java @@ -21,578 +21,627 @@ import java.util.EnumMap; import java.util.List; import java.util.Optional; - import org.iban4j.CountryCode; -/** - * Class that represents BBAN structure - */ +/** Class that represents BBAN structure */ public class BbanStructure { - private final BbanStructureEntry[] entries; - - private BbanStructure(final BbanStructureEntry... entries) { - this.entries = entries; - } - - - private static final EnumMap structures; + private static final EnumMap structures; + + /** + * French sub-territories may use their own country code (BL,RE,NC,...) or FR for their IBAN. + * Structure is the same, only the IBAN checksum differs. + */ + private static final BbanStructure FRENCH_STRUCTURE = + new BbanStructure( + BbanStructureEntry.bankCode(5, 'n'), + BbanStructureEntry.branchCode(5, 'n'), + BbanStructureEntry.accountNumber(11, 'c'), + BbanStructureEntry.nationalCheckDigit(2, 'n')); + + private static final BbanStructure UNITED_KINGDOM_STRUCTURE = + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), + BbanStructureEntry.branchCode(6, 'n'), + BbanStructureEntry.accountNumber(8, 'n')); + private static final BbanStructure FINLAND_STRUCTURE = + new BbanStructure( + BbanStructureEntry.bankCode(6, 'n'), + BbanStructureEntry.accountNumber(7, 'n'), + BbanStructureEntry.nationalCheckDigit(1, 'n')); + + static { + structures = new EnumMap<>(CountryCode.class); + + structures.put( + CountryCode.AL, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), + BbanStructureEntry.branchCode(4, 'n'), + BbanStructureEntry.nationalCheckDigit(1, 'n'), + BbanStructureEntry.accountNumber(16, 'c'))); + + structures.put( + CountryCode.AD, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'n'), + BbanStructureEntry.branchCode(4, 'n'), + BbanStructureEntry.accountNumber(12, 'c'))); + + structures.put( + CountryCode.AO, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'n'), + BbanStructureEntry.branchCode(4, 'n'), + BbanStructureEntry.accountNumber(11, 'n'), + BbanStructureEntry.nationalCheckDigit(2, 'n'))); + + structures.put( + CountryCode.AT, + new BbanStructure( + BbanStructureEntry.bankCode(5, 'n'), BbanStructureEntry.accountNumber(11, 'n'))); + + structures.put( + CountryCode.AZ, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), BbanStructureEntry.accountNumber(20, 'c'))); + + structures.put( + CountryCode.BH, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), BbanStructureEntry.accountNumber(14, 'c'))); + + structures.put( + CountryCode.BE, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), + BbanStructureEntry.accountNumber(7, 'n'), + BbanStructureEntry.nationalCheckDigit(2, 'n'))); + + structures.put( + CountryCode.BA, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), + BbanStructureEntry.branchCode(3, 'n'), + BbanStructureEntry.accountNumber(8, 'n'), + BbanStructureEntry.nationalCheckDigit(2, 'n'))); + + structures.put( + CountryCode.BR, + new BbanStructure( + BbanStructureEntry.bankCode(8, 'n'), + BbanStructureEntry.branchCode(5, 'n'), + BbanStructureEntry.accountNumber(10, 'n'), + BbanStructureEntry.accountType(1, 'a'), + BbanStructureEntry.ownerAccountNumber(1, 'c'))); - /** - * French sub-territories may use their own country code (BL,RE,NC,...) or FR for their IBAN. Structure is the - * same, only the IBAN checksum differs. - */ - private static final BbanStructure FRENCH_STRUCTURE = new BbanStructure( + structures.put( + CountryCode.BG, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), + BbanStructureEntry.branchCode(4, 'n'), + BbanStructureEntry.accountType(2, 'n'), + BbanStructureEntry.accountNumber(8, 'c'))); + + structures.put( + CountryCode.BY, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'c'), + BbanStructureEntry.branchCode(4, 'n'), + BbanStructureEntry.accountNumber(16, 'c'))); + + structures.put( + CountryCode.CR, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'n'), BbanStructureEntry.accountNumber(14, 'n'))); + + structures.put( + CountryCode.DE, + new BbanStructure( + BbanStructureEntry.bankCode(8, 'n'), BbanStructureEntry.accountNumber(10, 'n'))); + + structures.put( + CountryCode.HR, + new BbanStructure( + BbanStructureEntry.bankCode(7, 'n'), BbanStructureEntry.accountNumber(10, 'n'))); + + structures.put( + CountryCode.CY, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), + BbanStructureEntry.branchCode(5, 'n'), + BbanStructureEntry.accountNumber(16, 'c'))); + + structures.put( + CountryCode.CZ, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'n'), BbanStructureEntry.accountNumber(16, 'n'))); + + structures.put( + CountryCode.DK, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'n'), BbanStructureEntry.accountNumber(10, 'n'))); + + structures.put( + CountryCode.DO, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'c'), BbanStructureEntry.accountNumber(20, 'n'))); + + structures.put( + CountryCode.EE, + new BbanStructure( + BbanStructureEntry.bankCode(2, 'n'), + BbanStructureEntry.branchCode(2, 'n'), + BbanStructureEntry.accountNumber(11, 'n'), + BbanStructureEntry.nationalCheckDigit(1, 'n'))); + + structures.put( + CountryCode.EG, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'n'), + BbanStructureEntry.branchCode(4, 'n'), + BbanStructureEntry.accountNumber(17, 'n'))); + + structures.put( + CountryCode.FO, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'n'), + BbanStructureEntry.accountNumber(9, 'n'), + BbanStructureEntry.nationalCheckDigit(1, 'n'))); + + // Finland and its sub-territory (see https://www.iban.com/structure) + structures.put(CountryCode.FI, BbanStructure.FINLAND_STRUCTURE); + structures.put(CountryCode.AX, BbanStructure.FINLAND_STRUCTURE); + + // France and its sub-territories (see https://www.iban.com/structure) + structures.put(CountryCode.FR, BbanStructure.FRENCH_STRUCTURE); + structures.put(CountryCode.GF, BbanStructure.FRENCH_STRUCTURE); + structures.put(CountryCode.GP, BbanStructure.FRENCH_STRUCTURE); + structures.put(CountryCode.MQ, BbanStructure.FRENCH_STRUCTURE); + structures.put(CountryCode.RE, BbanStructure.FRENCH_STRUCTURE); + structures.put(CountryCode.PF, BbanStructure.FRENCH_STRUCTURE); + structures.put(CountryCode.TF, BbanStructure.FRENCH_STRUCTURE); + structures.put(CountryCode.YT, BbanStructure.FRENCH_STRUCTURE); + structures.put(CountryCode.NC, BbanStructure.FRENCH_STRUCTURE); + structures.put(CountryCode.BL, BbanStructure.FRENCH_STRUCTURE); + structures.put(CountryCode.MF, BbanStructure.FRENCH_STRUCTURE); + structures.put(CountryCode.PM, BbanStructure.FRENCH_STRUCTURE); + structures.put(CountryCode.WF, BbanStructure.FRENCH_STRUCTURE); + + structures.put( + CountryCode.GA, + new BbanStructure( BbanStructureEntry.bankCode(5, 'n'), BbanStructureEntry.branchCode(5, 'n'), - BbanStructureEntry.accountNumber(11, 'c'), - BbanStructureEntry.nationalCheckDigit(2, 'n')); - - private static final BbanStructure UNITED_KINGDOM_STRUCTURE = new BbanStructure( + BbanStructureEntry.accountNumber(13, 'c'))); + + structures.put( + CountryCode.GE, + new BbanStructure( + BbanStructureEntry.bankCode(2, 'a'), BbanStructureEntry.accountNumber(16, 'n'))); + + structures.put( + CountryCode.GI, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), BbanStructureEntry.accountNumber(15, 'c'))); + + structures.put( + CountryCode.GL, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'n'), BbanStructureEntry.accountNumber(10, 'n'))); + + structures.put( + CountryCode.GR, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), + BbanStructureEntry.branchCode(4, 'n'), + BbanStructureEntry.accountNumber(16, 'c'))); + + structures.put( + CountryCode.GT, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'c'), BbanStructureEntry.accountNumber(20, 'c'))); + + structures.put( + CountryCode.HU, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), + BbanStructureEntry.branchCode(4, 'n'), + BbanStructureEntry.accountNumber(16, 'n'), + BbanStructureEntry.nationalCheckDigit(1, 'n'))); + + structures.put( + CountryCode.IS, + new BbanStructure( + BbanStructureEntry.bankCode(2, 'n'), + BbanStructureEntry.branchCode(2, 'n'), + BbanStructureEntry.accountType(2, 'n'), + BbanStructureEntry.accountNumber(6, 'n'), + BbanStructureEntry.identificationNumber(10, 'n'))); + + structures.put( + CountryCode.IE, + new BbanStructure( BbanStructureEntry.bankCode(4, 'a'), BbanStructureEntry.branchCode(6, 'n'), - BbanStructureEntry.accountNumber(8, 'n')); - - private static final BbanStructure FINLAND_STRUCTURE = new BbanStructure( - BbanStructureEntry.bankCode(6, 'n'), - BbanStructureEntry.accountNumber(7, 'n'), - BbanStructureEntry.nationalCheckDigit(1, 'n')); - - static { - structures = new EnumMap<>(CountryCode.class); - - structures.put(CountryCode.AL, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.branchCode(4, 'n'), - BbanStructureEntry.nationalCheckDigit(1, 'n'), - BbanStructureEntry.accountNumber(16, 'c'))); - - structures.put(CountryCode.AD, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'n'), - BbanStructureEntry.branchCode(4, 'n'), - BbanStructureEntry.accountNumber(12, 'c'))); - - structures.put(CountryCode.AO, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'n'), - BbanStructureEntry.branchCode(4, 'n'), - BbanStructureEntry.accountNumber(11, 'n'), - BbanStructureEntry.nationalCheckDigit(2, 'n'))); - - structures.put(CountryCode.AT, - new BbanStructure( - BbanStructureEntry.bankCode(5, 'n'), - BbanStructureEntry.accountNumber(11, 'n'))); - - - structures.put(CountryCode.AZ, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.accountNumber(20, 'c'))); - - structures.put(CountryCode.BH, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.accountNumber(14, 'c'))); - - structures.put(CountryCode.BE, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.accountNumber(7, 'n'), - BbanStructureEntry.nationalCheckDigit(2, 'n'))); - - structures.put(CountryCode.BA, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.branchCode(3, 'n'), - BbanStructureEntry.accountNumber(8, 'n'), - BbanStructureEntry.nationalCheckDigit(2, 'n'))); - - structures.put(CountryCode.BR, - new BbanStructure( - BbanStructureEntry.bankCode(8, 'n'), - BbanStructureEntry.branchCode(5, 'n'), - BbanStructureEntry.accountNumber(10, 'n'), - BbanStructureEntry.accountType(1, 'a'), - BbanStructureEntry.ownerAccountNumber(1, 'c'))); - - structures.put(CountryCode.BG, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.branchCode(4, 'n'), - BbanStructureEntry.accountType(2, 'n'), - BbanStructureEntry.accountNumber(8, 'c'))); - - structures.put(CountryCode.BY, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'c'), - BbanStructureEntry.branchCode(4, 'n'), - BbanStructureEntry.accountNumber(16, 'c'))); - - structures.put(CountryCode.CR, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'n'), - BbanStructureEntry.accountNumber(14, 'n'))); - - structures.put(CountryCode.DE, - new BbanStructure( - BbanStructureEntry.bankCode(8, 'n'), - BbanStructureEntry.accountNumber(10, 'n'))); - - structures.put(CountryCode.HR, - new BbanStructure( - BbanStructureEntry.bankCode(7, 'n'), - BbanStructureEntry.accountNumber(10, 'n'))); - - structures.put(CountryCode.CY, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.branchCode(5, 'n'), - BbanStructureEntry.accountNumber(16, 'c'))); - - structures.put(CountryCode.CZ, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'n'), - BbanStructureEntry.accountNumber(16, 'n'))); - - structures.put(CountryCode.DK, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'n'), - BbanStructureEntry.accountNumber(10, 'n'))); - - structures.put(CountryCode.DO, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'c'), - BbanStructureEntry.accountNumber(20, 'n'))); - - structures.put(CountryCode.EE, - new BbanStructure( - BbanStructureEntry.bankCode(2, 'n'), - BbanStructureEntry.branchCode(2, 'n'), - BbanStructureEntry.accountNumber(11, 'n'), - BbanStructureEntry.nationalCheckDigit(1, 'n'))); - - structures.put(CountryCode.EG, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'n'), - BbanStructureEntry.branchCode(4, 'n'), - BbanStructureEntry.accountNumber(17, 'n')) - ); - - structures.put(CountryCode.FO, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'n'), - BbanStructureEntry.accountNumber(9, 'n'), - BbanStructureEntry.nationalCheckDigit(1, 'n'))); - - // Finland and its sub-territory (see https://www.iban.com/structure) - structures.put(CountryCode.FI, BbanStructure.FINLAND_STRUCTURE); - structures.put(CountryCode.AX, BbanStructure.FINLAND_STRUCTURE); - - // France and its sub-territories (see https://www.iban.com/structure) - structures.put(CountryCode.FR, BbanStructure.FRENCH_STRUCTURE); - structures.put(CountryCode.GF, BbanStructure.FRENCH_STRUCTURE); - structures.put(CountryCode.GP, BbanStructure.FRENCH_STRUCTURE); - structures.put(CountryCode.MQ, BbanStructure.FRENCH_STRUCTURE); - structures.put(CountryCode.RE, BbanStructure.FRENCH_STRUCTURE); - structures.put(CountryCode.PF, BbanStructure.FRENCH_STRUCTURE); - structures.put(CountryCode.TF, BbanStructure.FRENCH_STRUCTURE); - structures.put(CountryCode.YT, BbanStructure.FRENCH_STRUCTURE); - structures.put(CountryCode.NC, BbanStructure.FRENCH_STRUCTURE); - structures.put(CountryCode.BL, BbanStructure.FRENCH_STRUCTURE); - structures.put(CountryCode.MF, BbanStructure.FRENCH_STRUCTURE); - structures.put(CountryCode.PM, BbanStructure.FRENCH_STRUCTURE); - structures.put(CountryCode.WF, BbanStructure.FRENCH_STRUCTURE); - - structures.put(CountryCode.GA, - new BbanStructure( - BbanStructureEntry.bankCode(5, 'n'), - BbanStructureEntry.branchCode(5, 'n'), - BbanStructureEntry.accountNumber(13, 'c'))); - - structures.put(CountryCode.GE, - new BbanStructure( - BbanStructureEntry.bankCode(2, 'a'), - BbanStructureEntry.accountNumber(16, 'n'))); - - structures.put(CountryCode.GI, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.accountNumber(15, 'c'))); - - structures.put(CountryCode.GL, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'n'), - BbanStructureEntry.accountNumber(10, 'n'))); - - structures.put(CountryCode.GR, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.branchCode(4, 'n'), - BbanStructureEntry.accountNumber(16, 'c'))); - - structures.put(CountryCode.GT, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'c'), - BbanStructureEntry.accountNumber(20, 'c'))); - - structures.put(CountryCode.HU, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.branchCode(4, 'n'), - BbanStructureEntry.accountNumber(16, 'n'), - BbanStructureEntry.nationalCheckDigit(1, 'n'))); - - structures.put(CountryCode.IS, - new BbanStructure( - BbanStructureEntry.bankCode(2, 'n'), - BbanStructureEntry.branchCode(2, 'n'), - BbanStructureEntry.accountType(2, 'n'), - BbanStructureEntry.accountNumber(6, 'n'), - BbanStructureEntry.identificationNumber(10, 'n'))); - - structures.put(CountryCode.IE, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.branchCode(6, 'n'), - BbanStructureEntry.accountNumber(8, 'n'))); - - structures.put(CountryCode.IL, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.branchCode(3, 'n'), - BbanStructureEntry.accountNumber(13, 'n'))); - - structures.put(CountryCode.IR, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.accountNumber(19, 'n'))); - - structures.put(CountryCode.IT, - new BbanStructure( - BbanStructureEntry.nationalCheckDigit(1, 'a'), - BbanStructureEntry.bankCode(5, 'n'), - BbanStructureEntry.branchCode(5, 'n'), - BbanStructureEntry.accountNumber(12, 'c'))); - - structures.put(CountryCode.JO, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.branchCode(4, 'n'), - BbanStructureEntry.accountNumber(18, 'c'))); - - structures.put(CountryCode.KZ, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.accountNumber(13, 'c'))); - - structures.put(CountryCode.KW, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.accountNumber(22, 'c'))); - - structures.put(CountryCode.LC, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.accountNumber(24, 'c'))); - - structures.put(CountryCode.LV, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.accountNumber(13, 'c'))); - - structures.put(CountryCode.LB, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'n'), - BbanStructureEntry.accountNumber(20, 'c'))); - - structures.put(CountryCode.LI, - new BbanStructure( - BbanStructureEntry.bankCode(5, 'n'), - BbanStructureEntry.accountNumber(12, 'c'))); - - structures.put(CountryCode.LT, - new BbanStructure( - BbanStructureEntry.bankCode(5, 'n'), - BbanStructureEntry.accountNumber(11, 'n'))); - - structures.put(CountryCode.LU, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.accountNumber(13, 'c'))); - - structures.put(CountryCode.MK, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.accountNumber(10, 'c'), - BbanStructureEntry.nationalCheckDigit(2, 'n'))); - - structures.put(CountryCode.MT, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.branchCode(5, 'n'), - BbanStructureEntry.accountNumber(18, 'c'))); - - structures.put(CountryCode.MR, - new BbanStructure( - BbanStructureEntry.bankCode(5, 'n'), - BbanStructureEntry.branchCode(5, 'n'), - BbanStructureEntry.accountNumber(11, 'n'), - BbanStructureEntry.nationalCheckDigit(2, 'n'))); - - structures.put(CountryCode.MU, - new BbanStructure( - BbanStructureEntry.bankCode(6, 'c'), - BbanStructureEntry.branchCode(2, 'n'), - BbanStructureEntry.accountNumber(18, 'c'))); - - structures.put(CountryCode.MD, - new BbanStructure( - BbanStructureEntry.bankCode(2, 'c'), - BbanStructureEntry.accountNumber(18, 'c'))); - - structures.put(CountryCode.MC, - new BbanStructure( - BbanStructureEntry.bankCode(5, 'n'), - BbanStructureEntry.branchCode(5, 'n'), - BbanStructureEntry.accountNumber(11, 'c'), - BbanStructureEntry.nationalCheckDigit(2, 'n'))); - - structures.put(CountryCode.ME, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.accountNumber(13, 'n'), - BbanStructureEntry.nationalCheckDigit(2, 'n'))); - - structures.put(CountryCode.NL, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.accountNumber(10, 'n'))); - - structures.put(CountryCode.NO, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'n'), - BbanStructureEntry.accountNumber(6, 'n'), - BbanStructureEntry.nationalCheckDigit(1, 'n'))); - - structures.put(CountryCode.PK, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'c'), - BbanStructureEntry.accountNumber(16, 'n'))); - - structures.put(CountryCode.PS, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.accountNumber(21, 'c'))); - - structures.put(CountryCode.PL, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.branchCode(4, 'n'), - BbanStructureEntry.nationalCheckDigit(1, 'n'), - BbanStructureEntry.accountNumber(16, 'n'))); - - structures.put(CountryCode.PT, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'n'), - BbanStructureEntry.branchCode(4, 'n'), - BbanStructureEntry.accountNumber(11, 'n'), - BbanStructureEntry.nationalCheckDigit(2, 'n'))); - - structures.put(CountryCode.RO, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.accountNumber(16, 'c'))); - - structures.put(CountryCode.QA, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.accountNumber(21, 'c'))); - - structures.put(CountryCode.SC, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.branchCode(4, 'n'), - BbanStructureEntry.accountNumber(16, 'n'), - BbanStructureEntry.accountType(3, 'a'))); - - structures.put(CountryCode.SM, - new BbanStructure( - BbanStructureEntry.nationalCheckDigit(1, 'a'), - BbanStructureEntry.bankCode(5, 'n'), - BbanStructureEntry.branchCode(5, 'n'), - BbanStructureEntry.accountNumber(12, 'c'))); - - structures.put(CountryCode.ST, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'n'), - BbanStructureEntry.branchCode(4, 'n'), - BbanStructureEntry.accountNumber(13, 'n'))); - - structures.put(CountryCode.SA, - new BbanStructure( - BbanStructureEntry.bankCode(2, 'n'), - BbanStructureEntry.accountNumber(18, 'c'))); - - structures.put(CountryCode.RS, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.accountNumber(13, 'n'), - BbanStructureEntry.nationalCheckDigit(2, 'n'))); - - structures.put(CountryCode.RU, - new BbanStructure( - BbanStructureEntry.bankCode(9, 'n'), - BbanStructureEntry.branchCode(5, 'n'), - BbanStructureEntry.accountNumber(15, 'c'))); - - structures.put(CountryCode.SK, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'n'), - BbanStructureEntry.accountNumber(16, 'n'))); - - structures.put(CountryCode.SI, - new BbanStructure( - BbanStructureEntry.bankCode(2, 'n'), - BbanStructureEntry.branchCode(3, 'n'), - BbanStructureEntry.accountNumber(8, 'n'), - BbanStructureEntry.nationalCheckDigit(2, 'n'))); - - structures.put(CountryCode.SV, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.accountNumber(20, 'n'))); - - structures.put(CountryCode.ES, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'n'), - BbanStructureEntry.branchCode(4, 'n'), - BbanStructureEntry.nationalCheckDigit(2, 'n'), - BbanStructureEntry.accountNumber(10, 'n'))); - - structures.put(CountryCode.SE, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.accountNumber(17, 'n'))); - - structures.put(CountryCode.CH, - new BbanStructure( - BbanStructureEntry.bankCode(5, 'n'), - BbanStructureEntry.accountNumber(12, 'c'))); - - structures.put(CountryCode.TN, - new BbanStructure( - BbanStructureEntry.bankCode(2, 'n'), - BbanStructureEntry.branchCode(3, 'n'), - BbanStructureEntry.accountNumber(15, 'c'))); - - structures.put(CountryCode.TR, - new BbanStructure( - BbanStructureEntry.bankCode(5, 'n'), - BbanStructureEntry.nationalCheckDigit(1, 'c'), - BbanStructureEntry.accountNumber(16, 'c'))); - - structures.put(CountryCode.UA, - new BbanStructure( - BbanStructureEntry.bankCode(6, 'n'), - BbanStructureEntry.accountNumber(19, 'n'))); - - - // UK and its sub-territories (see https://www.iban.com/structure) - structures.put(CountryCode.GB, BbanStructure.UNITED_KINGDOM_STRUCTURE); - structures.put(CountryCode.IM, BbanStructure.UNITED_KINGDOM_STRUCTURE); - structures.put(CountryCode.GG, BbanStructure.UNITED_KINGDOM_STRUCTURE); - structures.put(CountryCode.JE, BbanStructure.UNITED_KINGDOM_STRUCTURE); - - structures.put(CountryCode.AE, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.accountNumber(16, 'c'))); - - structures.put(CountryCode.VA, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.accountNumber(15, 'n'))); - - structures.put(CountryCode.VG, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.accountNumber(16, 'n'))); - - structures.put(CountryCode.TL, - new BbanStructure( - BbanStructureEntry.bankCode(3, 'n'), - BbanStructureEntry.accountNumber(14, 'n'), - BbanStructureEntry.nationalCheckDigit(2, 'n'))); - - structures.put(CountryCode.XK, - new BbanStructure( - BbanStructureEntry.bankCode(2, 'n'), - BbanStructureEntry.branchCode(2, 'n'), - BbanStructureEntry.accountNumber(10, 'n'), - BbanStructureEntry.nationalCheckDigit(2, 'n'))); - - structures.put(CountryCode.IQ, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'a'), - BbanStructureEntry.branchCode(3, 'n'), - BbanStructureEntry.accountNumber(12, 'n'))); - - structures.put(CountryCode.CV, - new BbanStructure( - BbanStructureEntry.bankCode(4, 'n'), - BbanStructureEntry.branchCode(4, 'n'), - BbanStructureEntry.accountNumber(13, 'c'))); - - structures.put(CountryCode.OM, new BbanStructure(BbanStructureEntry.bankCode(3, 'n'), BbanStructureEntry.accountNumber(16, 'c'))); - } - - /** - * @param countryCode the country code. - * @return BbanStructure for specified country or null if country is not supported. - */ - public static BbanStructure forCountry(final CountryCode countryCode) { - return structures.get(countryCode); - } - - /** - * Checks whether national Check digit is mandatory for specific country - * - * @param countryCode the country code - * @return true/false - */ - public static boolean hasNationalCheckDigit(final CountryCode countryCode) { - final Optional bbanStructure = Optional.ofNullable(forCountry(countryCode)); - return bbanStructure.map(structure -> structure.getEntries() - .stream() - .anyMatch(e -> BbanEntryType.national_check_digit.equals(e.getEntryType()))) - .orElse(false); - } + BbanStructureEntry.accountNumber(8, 'n'))); + + structures.put( + CountryCode.IL, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), + BbanStructureEntry.branchCode(3, 'n'), + BbanStructureEntry.accountNumber(13, 'n'))); + + structures.put( + CountryCode.IR, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), BbanStructureEntry.accountNumber(19, 'n'))); + + structures.put( + CountryCode.IT, + new BbanStructure( + BbanStructureEntry.nationalCheckDigit(1, 'a'), + BbanStructureEntry.bankCode(5, 'n'), + BbanStructureEntry.branchCode(5, 'n'), + BbanStructureEntry.accountNumber(12, 'c'))); - public List getEntries() { - return Collections.unmodifiableList(Arrays.asList(entries)); - } + structures.put( + CountryCode.JO, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), + BbanStructureEntry.branchCode(4, 'n'), + BbanStructureEntry.accountNumber(18, 'c'))); + + structures.put( + CountryCode.KZ, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), BbanStructureEntry.accountNumber(13, 'c'))); + + structures.put( + CountryCode.KW, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), BbanStructureEntry.accountNumber(22, 'c'))); + + structures.put( + CountryCode.LC, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), BbanStructureEntry.accountNumber(24, 'c'))); + + structures.put( + CountryCode.LV, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), BbanStructureEntry.accountNumber(13, 'c'))); + + structures.put( + CountryCode.LB, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'n'), BbanStructureEntry.accountNumber(20, 'c'))); + + structures.put( + CountryCode.LI, + new BbanStructure( + BbanStructureEntry.bankCode(5, 'n'), BbanStructureEntry.accountNumber(12, 'c'))); + + structures.put( + CountryCode.LT, + new BbanStructure( + BbanStructureEntry.bankCode(5, 'n'), BbanStructureEntry.accountNumber(11, 'n'))); + + structures.put( + CountryCode.LU, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), BbanStructureEntry.accountNumber(13, 'c'))); + + structures.put( + CountryCode.MK, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), + BbanStructureEntry.accountNumber(10, 'c'), + BbanStructureEntry.nationalCheckDigit(2, 'n'))); + + structures.put( + CountryCode.MT, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), + BbanStructureEntry.branchCode(5, 'n'), + BbanStructureEntry.accountNumber(18, 'c'))); - public static List supportedCountries() { - final List countryCodes = new ArrayList(structures.size()); - countryCodes.addAll(structures.keySet()); - return Collections.unmodifiableList(countryCodes); + structures.put( + CountryCode.MR, + new BbanStructure( + BbanStructureEntry.bankCode(5, 'n'), + BbanStructureEntry.branchCode(5, 'n'), + BbanStructureEntry.accountNumber(11, 'n'), + BbanStructureEntry.nationalCheckDigit(2, 'n'))); + + structures.put( + CountryCode.MU, + new BbanStructure( + BbanStructureEntry.bankCode(6, 'c'), + BbanStructureEntry.branchCode(2, 'n'), + BbanStructureEntry.accountNumber(18, 'c'))); + + structures.put( + CountryCode.MD, + new BbanStructure( + BbanStructureEntry.bankCode(2, 'c'), BbanStructureEntry.accountNumber(18, 'c'))); + + structures.put( + CountryCode.MC, + new BbanStructure( + BbanStructureEntry.bankCode(5, 'n'), + BbanStructureEntry.branchCode(5, 'n'), + BbanStructureEntry.accountNumber(11, 'c'), + BbanStructureEntry.nationalCheckDigit(2, 'n'))); + + structures.put( + CountryCode.ME, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), + BbanStructureEntry.accountNumber(13, 'n'), + BbanStructureEntry.nationalCheckDigit(2, 'n'))); + + structures.put( + CountryCode.NL, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), BbanStructureEntry.accountNumber(10, 'n'))); + + structures.put( + CountryCode.NO, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'n'), + BbanStructureEntry.accountNumber(6, 'n'), + BbanStructureEntry.nationalCheckDigit(1, 'n'))); + + structures.put( + CountryCode.PK, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'c'), BbanStructureEntry.accountNumber(16, 'n'))); + + structures.put( + CountryCode.PS, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), BbanStructureEntry.accountNumber(21, 'c'))); + + structures.put( + CountryCode.PL, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), + BbanStructureEntry.branchCode(4, 'n'), + BbanStructureEntry.nationalCheckDigit(1, 'n'), + BbanStructureEntry.accountNumber(16, 'n'))); + + structures.put( + CountryCode.PT, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'n'), + BbanStructureEntry.branchCode(4, 'n'), + BbanStructureEntry.accountNumber(11, 'n'), + BbanStructureEntry.nationalCheckDigit(2, 'n'))); + + structures.put( + CountryCode.RO, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), BbanStructureEntry.accountNumber(16, 'c'))); + + structures.put( + CountryCode.QA, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), BbanStructureEntry.accountNumber(21, 'c'))); + + structures.put( + CountryCode.SC, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), + BbanStructureEntry.branchCode(4, 'n'), + BbanStructureEntry.accountNumber(16, 'n'), + BbanStructureEntry.accountType(3, 'a'))); + + structures.put( + CountryCode.SM, + new BbanStructure( + BbanStructureEntry.nationalCheckDigit(1, 'a'), + BbanStructureEntry.bankCode(5, 'n'), + BbanStructureEntry.branchCode(5, 'n'), + BbanStructureEntry.accountNumber(12, 'c'))); + + structures.put( + CountryCode.ST, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'n'), + BbanStructureEntry.branchCode(4, 'n'), + BbanStructureEntry.accountNumber(13, 'n'))); + + structures.put( + CountryCode.SA, + new BbanStructure( + BbanStructureEntry.bankCode(2, 'n'), BbanStructureEntry.accountNumber(18, 'c'))); + + structures.put( + CountryCode.RS, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), + BbanStructureEntry.accountNumber(13, 'n'), + BbanStructureEntry.nationalCheckDigit(2, 'n'))); + + structures.put( + CountryCode.RU, + new BbanStructure( + BbanStructureEntry.bankCode(9, 'n'), + BbanStructureEntry.branchCode(5, 'n'), + BbanStructureEntry.accountNumber(15, 'c'))); + + structures.put( + CountryCode.SK, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'n'), BbanStructureEntry.accountNumber(16, 'n'))); + + structures.put( + CountryCode.SI, + new BbanStructure( + BbanStructureEntry.bankCode(2, 'n'), + BbanStructureEntry.branchCode(3, 'n'), + BbanStructureEntry.accountNumber(8, 'n'), + BbanStructureEntry.nationalCheckDigit(2, 'n'))); + + structures.put( + CountryCode.SV, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), BbanStructureEntry.accountNumber(20, 'n'))); + + structures.put( + CountryCode.ES, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'n'), + BbanStructureEntry.branchCode(4, 'n'), + BbanStructureEntry.nationalCheckDigit(2, 'n'), + BbanStructureEntry.accountNumber(10, 'n'))); + + structures.put( + CountryCode.SE, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), BbanStructureEntry.accountNumber(17, 'n'))); + + structures.put( + CountryCode.CH, + new BbanStructure( + BbanStructureEntry.bankCode(5, 'n'), BbanStructureEntry.accountNumber(12, 'c'))); + + structures.put( + CountryCode.TN, + new BbanStructure( + BbanStructureEntry.bankCode(2, 'n'), + BbanStructureEntry.branchCode(3, 'n'), + BbanStructureEntry.accountNumber(15, 'c'))); + + structures.put( + CountryCode.TR, + new BbanStructure( + BbanStructureEntry.bankCode(5, 'n'), + BbanStructureEntry.nationalCheckDigit(1, 'c'), + BbanStructureEntry.accountNumber(16, 'c'))); + + structures.put( + CountryCode.UA, + new BbanStructure( + BbanStructureEntry.bankCode(6, 'n'), BbanStructureEntry.accountNumber(19, 'n'))); + + // UK and its sub-territories (see https://www.iban.com/structure) + structures.put(CountryCode.GB, BbanStructure.UNITED_KINGDOM_STRUCTURE); + structures.put(CountryCode.IM, BbanStructure.UNITED_KINGDOM_STRUCTURE); + structures.put(CountryCode.GG, BbanStructure.UNITED_KINGDOM_STRUCTURE); + structures.put(CountryCode.JE, BbanStructure.UNITED_KINGDOM_STRUCTURE); + + structures.put( + CountryCode.AE, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), BbanStructureEntry.accountNumber(16, 'c'))); + + structures.put( + CountryCode.VA, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), BbanStructureEntry.accountNumber(15, 'n'))); + + structures.put( + CountryCode.VG, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), BbanStructureEntry.accountNumber(16, 'n'))); + + structures.put( + CountryCode.TL, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), + BbanStructureEntry.accountNumber(14, 'n'), + BbanStructureEntry.nationalCheckDigit(2, 'n'))); + + structures.put( + CountryCode.XK, + new BbanStructure( + BbanStructureEntry.bankCode(2, 'n'), + BbanStructureEntry.branchCode(2, 'n'), + BbanStructureEntry.accountNumber(10, 'n'), + BbanStructureEntry.nationalCheckDigit(2, 'n'))); + + structures.put( + CountryCode.IQ, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'a'), + BbanStructureEntry.branchCode(3, 'n'), + BbanStructureEntry.accountNumber(12, 'n'))); + + structures.put( + CountryCode.CV, + new BbanStructure( + BbanStructureEntry.bankCode(4, 'n'), + BbanStructureEntry.branchCode(4, 'n'), + BbanStructureEntry.accountNumber(13, 'c'))); + + structures.put( + CountryCode.OM, + new BbanStructure( + BbanStructureEntry.bankCode(3, 'n'), BbanStructureEntry.accountNumber(16, 'c'))); + + structures.put( + CountryCode.BI, + new BbanStructure( + BbanStructureEntry.bankCode(5, 'n'), + BbanStructureEntry.branchCode(5, 'n'), + BbanStructureEntry.accountNumber(13, 'n'))); + } + + private final BbanStructureEntry[] entries; + + private BbanStructure(final BbanStructureEntry... entries) { + this.entries = entries; + } + + /** + * @param countryCode the country code. + * @return BbanStructure for specified country or null if country is not supported. + */ + public static BbanStructure forCountry(final CountryCode countryCode) { + return structures.get(countryCode); + } + + /** + * Checks whether national Check digit is mandatory for specific country + * + * @param countryCode the country code + * @return true/false + */ + public static boolean hasNationalCheckDigit(final CountryCode countryCode) { + final Optional bbanStructure = Optional.ofNullable(forCountry(countryCode)); + return bbanStructure + .map( + structure -> + structure.getEntries().stream() + .anyMatch(e -> BbanEntryType.national_check_digit.equals(e.getEntryType()))) + .orElse(false); + } + + public static List supportedCountries() { + final List countryCodes = new ArrayList(structures.size()); + countryCodes.addAll(structures.keySet()); + return Collections.unmodifiableList(countryCodes); + } + + public List getEntries() { + return Collections.unmodifiableList(Arrays.asList(entries)); + } + + /** + * Returns the length of bban. + * + * @return int length + */ + public int getBbanLength() { + int length = 0; + + for (final BbanStructureEntry entry : entries) { + length += entry.getLength(); } - /** - * Returns the length of bban. - * - * @return int length - */ - public int getBbanLength() { - int length = 0; - - for (final BbanStructureEntry entry : entries) { - length += entry.getLength(); - } - - return length; - } + return length; + } } diff --git a/src/test/java/org/iban4j/IbanTest.java b/src/test/java/org/iban4j/IbanTest.java index 89cf06c..41525e6 100644 --- a/src/test/java/org/iban4j/IbanTest.java +++ b/src/test/java/org/iban4j/IbanTest.java @@ -28,13 +28,19 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import java.util.Random; - import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @DisplayName("Iban general test") final class IbanTest { + private static void assertIbanBuilderRandomWithSeedEquals(final String expected, final int seed) { + final Iban generated = new Iban.Builder(new Random(seed)).buildRandom(); + final String actual = generated.toFormattedString(); + assertEquals( + expected, actual, "expect that creating an IBAN with seed '" + seed + "' is deterministic"); + } + @Test @DisplayName("IBANs With Same Data Should Be Equal") public void ibansWithSameDataShouldBeEqual() { @@ -294,10 +300,10 @@ public void ibanConstructionRandom() { @Test public void ibanConstructionSeeded() { - assertAll(() -> assertIbanUtilRandomWithSeedEquals("TN58 1908 31HJ ENIS JS33 9QZG", 1), - () -> assertIbanUtilRandomWithSeedEquals("LV92 QKBB C1OY WHST MPQA 7", 2), - () -> assertIbanUtilRandomWithSeedEquals("JO53 WQSM 2804 ERG8 WOUQ NLYT EEL7 3J", 3) - ); + assertAll( + () -> assertIbanUtilRandomWithSeedEquals("FR46 1918 2083 691H JENI SJS3 364", 1), + () -> assertIbanUtilRandomWithSeedEquals("LC94 QKBB C1OY WHST MPQA 7GVB 4WBX VTP0", 2), + () -> assertIbanUtilRandomWithSeedEquals("DK23 0882 2804 1804 23", 3)); } private void assertIbanUtilRandomWithSeedEquals( @@ -314,23 +320,10 @@ private void assertIbanUtilRandomWithSeedEquals( @Test public void ibanBuilderConstructionSeeded() { - assertAll(() -> assertIbanBuilderRandomWithSeedEquals("TN58 1908 31HJ ENIS JS33 9QZG", 1), - () -> assertIbanBuilderRandomWithSeedEquals("LV92 QKBB C1OY WHST MPQA 7", 2), - () -> assertIbanBuilderRandomWithSeedEquals("JO53 WQSM 2804 ERG8 WOUQ NLYT EEL7 3J", 3) - ); - } - - private static void assertIbanBuilderRandomWithSeedEquals( - final String expected, - final int seed - ) { - final Iban generated = new Iban.Builder(new Random(seed)).buildRandom(); - final String actual = generated.toFormattedString(); - assertEquals( - expected, - actual, - "expect that creating an IBAN with seed '" + seed + "' is deterministic" - ); + assertAll( + () -> assertIbanBuilderRandomWithSeedEquals("FR46 1918 2083 691H JENI SJS3 364", 1), + () -> assertIbanBuilderRandomWithSeedEquals("LC94 QKBB C1OY WHST MPQA 7GVB 4WBX VTP0", 2), + () -> assertIbanBuilderRandomWithSeedEquals("DK23 0882 2804 1804 23", 3)); } @Test diff --git a/src/test/java/org/iban4j/TestDataHelper.java b/src/test/java/org/iban4j/TestDataHelper.java index 847fd8f..6892e5c 100644 --- a/src/test/java/org/iban4j/TestDataHelper.java +++ b/src/test/java/org/iban4j/TestDataHelper.java @@ -19,613 +19,923 @@ import java.util.Collection; final class TestDataHelper { - public static final String defaultExceptionMessage = "Expected doThing() to throw, but it didn't"; + public static final String defaultExceptionMessage = "Expected doThing() to throw, but it didn't"; - private TestDataHelper() { - } + private TestDataHelper() {} - public static Collection getIbanData() { - return Arrays.asList(new Object[][]{ - {new Iban.Builder() - .countryCode(CountryCode.AL) - .bankCode("212") - .branchCode("1100") - .accountNumber("0000000235698741") - .nationalCheckDigit("9") - .build(), "AL47212110090000000235698741"}, - {new Iban.Builder() - .countryCode(CountryCode.AD) - .bankCode("0001") - .branchCode("2030") - .accountNumber("200359100100") - .build(), "AD1200012030200359100100"}, - {new Iban.Builder() - .countryCode(CountryCode.AO) - .bankCode("0006") - .branchCode("0000") - .accountNumber("53518203301") - .nationalCheckDigit("69") - .build(), "AO06000600005351820330169"}, - {new Iban.Builder() - .countryCode(CountryCode.AT) - .bankCode("19043") - .accountNumber("00234573201") - .build(), "AT611904300234573201"}, - {new Iban.Builder() - .countryCode(CountryCode.AZ) - .bankCode("NABZ") - .accountNumber("00000000137010001944") - .build(), "AZ21NABZ00000000137010001944"}, - {new Iban.Builder() - .countryCode(CountryCode.BH) - .bankCode("SCBL") - .accountNumber("BHD18903608801") - .build(), "BH72SCBLBHD18903608801"}, - {new Iban.Builder() - .countryCode(CountryCode.BE) - .bankCode("539") - .accountNumber("0075470") - .nationalCheckDigit("34") - .build(), "BE68539007547034"}, - {new Iban.Builder() - .countryCode(CountryCode.BA) - .bankCode("129") - .branchCode("007") - .accountNumber("94010284") - .nationalCheckDigit("94") - .build(), "BA391290079401028494"}, - {new Iban.Builder() - .countryCode(CountryCode.BR) - .bankCode("00360305") - .branchCode("00001") - .accountNumber("0009795493") - .accountType("P") - .ownerAccountType("1") - .build(), "BR9700360305000010009795493P1"}, - {new Iban.Builder() - .countryCode(CountryCode.BG) - .bankCode("BNBG") - .branchCode("9661") - .accountNumber("20345678") - .accountType("10") - .build(), "BG80BNBG96611020345678"}, - {new Iban.Builder() - .countryCode(CountryCode.BL) - .bankCode("12345") - .branchCode("12345") - .accountNumber("123456789AB") - .nationalCheckDigit("13") - .build(), "BL391234512345123456789AB13"}, - {new Iban.Builder() - .countryCode(CountryCode.BY) - .bankCode("NBRB") - .branchCode("3600") - .accountNumber("900000002Z00AB00") - .build(), "BY13NBRB3600900000002Z00AB00"}, - {new Iban.Builder() - .countryCode(CountryCode.CR) - .bankCode("0152") - .accountNumber("02001026284066") - .build(), "CR05015202001026284066"}, - {new Iban.Builder() - .countryCode(CountryCode.HR) - .bankCode("1001005") - .accountNumber("1863000160") - .build(), "HR1210010051863000160"}, - {new Iban.Builder() - .countryCode(CountryCode.CY) - .bankCode("002") - .branchCode("00128") - .accountNumber("0000001200527600") - .build(), "CY17002001280000001200527600"}, - {new Iban.Builder() - .countryCode(CountryCode.CZ) - .bankCode("0800") - .accountNumber("0000192000145399") - .build(), "CZ6508000000192000145399"}, - {new Iban.Builder() - .countryCode(CountryCode.DK) - .bankCode("0040") - .accountNumber("0440116243") - .build(), "DK5000400440116243"}, - {new Iban.Builder() - .countryCode(CountryCode.DO) - .bankCode("BAGR") - .accountNumber("00000001212453611324") - .build(), "DO28BAGR00000001212453611324"}, - {new Iban.Builder() - .countryCode(CountryCode.EE) - .bankCode("22") - .branchCode("00") - .accountNumber("22102014568") - .nationalCheckDigit("5") - .build(), "EE382200221020145685"}, - {new Iban.Builder() - .countryCode(CountryCode.EG) - .bankCode("0019") - .branchCode("0005") - .accountNumber("00000000263180002") - .build(), "EG380019000500000000263180002"}, - {new Iban.Builder() - .countryCode(CountryCode.FI) - .bankCode("123456") - .accountNumber("0000078") - .nationalCheckDigit("5") - .build(), "FI2112345600000785"}, - {new Iban.Builder() - .countryCode(CountryCode.AX) - .bankCode("987654") - .accountNumber("0002033") - .nationalCheckDigit("5") - .build(), "AX7898765400020335"}, - {new Iban.Builder() - .countryCode(CountryCode.FR) - .bankCode("20041") - .branchCode("01005") - .accountNumber("0500013M026") - .nationalCheckDigit("06") - .build(), "FR1420041010050500013M02606"}, - {new Iban.Builder() - .countryCode(CountryCode.GE) - .bankCode("NB") - .accountNumber("0000000101904917") - .build(), "GE29NB0000000101904917"}, - {new Iban.Builder() - .countryCode(CountryCode.GF) - .bankCode("12345") - .branchCode("12345") - .accountNumber("123456789AB") - .nationalCheckDigit("13") - .build(), "GF121234512345123456789AB13"}, - {new Iban.Builder() - .countryCode(CountryCode.DE) - .bankCode("37040044") - .accountNumber("0532013000") - .build(), "DE89370400440532013000"}, - {new Iban.Builder() - .countryCode(CountryCode.GI) - .bankCode("NWBK") - .accountNumber("000000007099453") - .build(), "GI75NWBK000000007099453"}, - {new Iban.Builder() - .countryCode(CountryCode.GP) - .bankCode("12345") - .branchCode("12345") - .accountNumber("123456789AB") - .nationalCheckDigit("13") - .build(), "GP791234512345123456789AB13"}, - {new Iban.Builder() - .countryCode(CountryCode.GR) - .bankCode("011") - .branchCode("0125") - .accountNumber("0000000012300695") - .build(), "GR1601101250000000012300695"}, - {new Iban.Builder() - .countryCode(CountryCode.GT) - .bankCode("TRAJ") - .accountNumber("01020000001210029690") - .build(), "GT82TRAJ01020000001210029690"}, - {new Iban.Builder() - .countryCode(CountryCode.HU) - .bankCode("117") - .branchCode("7301") - .accountNumber("6111110180000000") - .nationalCheckDigit("0") - .build(), "HU42117730161111101800000000"}, - {new Iban.Builder() - .countryCode(CountryCode.IS) - .bankCode("01") - .branchCode("59") - .accountType("26") - .accountNumber("007654") - .identificationNumber("5510730339") - .build(), "IS140159260076545510730339"}, - {new Iban.Builder() - .countryCode(CountryCode.IE) - .bankCode("AIBK") - .branchCode("931152") - .accountNumber("12345678") - .build(), "IE29AIBK93115212345678"}, - {new Iban.Builder() - .countryCode(CountryCode.IL) - .bankCode("010") - .branchCode("800") - .accountNumber("0000099999999") - .build(), "IL620108000000099999999"}, - {new Iban.Builder() - .countryCode(CountryCode.IT) - .bankCode("05428") - .branchCode("11101") - .nationalCheckDigit("X") - .accountNumber("000000123456") - .build(), "IT60X0542811101000000123456"}, - {new Iban.Builder() - .countryCode(CountryCode.JO) - .bankCode("CBJO") - .branchCode("0010") - .accountNumber("000000000131000302") - .build(), "JO94CBJO0010000000000131000302"}, - {new Iban.Builder() - .countryCode(CountryCode.KZ) - .bankCode("125") - .accountNumber("KZT5004100100") - .build(), "KZ86125KZT5004100100"}, - {new Iban.Builder() - .countryCode(CountryCode.KW) - .bankCode("CBKU") - .accountNumber("0000000000001234560101") - .build(), "KW81CBKU0000000000001234560101"}, - {new Iban.Builder() - .countryCode(CountryCode.LC) - .bankCode("HEMM") - .accountNumber("000100010012001200023015") - .build(), "LC55HEMM000100010012001200023015"}, - {new Iban.Builder() - .countryCode(CountryCode.LV) - .bankCode("BANK") - .accountNumber("0000435195001") - .build(), "LV80BANK0000435195001"}, - {new Iban.Builder() - .countryCode(CountryCode.LB) - .bankCode("0999") - .accountNumber("00000001001901229114") - .build(), "LB62099900000001001901229114"}, - {new Iban.Builder() - .countryCode(CountryCode.LI) - .bankCode("08810") - .accountNumber("0002324013AA") - .build(), "LI21088100002324013AA"}, - {new Iban.Builder() - .countryCode(CountryCode.LT) - .bankCode("10000") - .accountNumber("11101001000") - .build(), "LT121000011101001000"}, - {new Iban.Builder() - .countryCode(CountryCode.LU) - .bankCode("001") - .accountNumber("9400644750000") - .build(), "LU280019400644750000"}, - {new Iban.Builder() - .countryCode(CountryCode.MF) - .bankCode("12345") - .branchCode("12345") - .accountNumber("123456789AB") - .nationalCheckDigit("13") - .build(), "MF551234512345123456789AB13"}, - {new Iban.Builder() - .countryCode(CountryCode.MK) - .bankCode("250") - .accountNumber("1200000589") - .nationalCheckDigit("84") - .build(), "MK07250120000058984"}, - {new Iban.Builder() - .countryCode(CountryCode.MT) - .bankCode("MALT") - .branchCode("01100") - .accountNumber("0012345MTLCAST001S") - .build(), "MT84MALT011000012345MTLCAST001S"}, - {new Iban.Builder() - .countryCode(CountryCode.MR) - .bankCode("00020") - .branchCode("00101") - .accountNumber("00001234567") - .nationalCheckDigit("53") - .build(), "MR1300020001010000123456753"}, - {new Iban.Builder() - .countryCode(CountryCode.MU) - .bankCode("BOMM01") - .branchCode("01") - .accountNumber("101030300200000MUR") - .build(), "MU17BOMM0101101030300200000MUR"}, - {new Iban.Builder() - .countryCode(CountryCode.MD) - .bankCode("AG") - .accountNumber("000225100013104168") - .build(), "MD24AG000225100013104168"}, - {new Iban.Builder() - .countryCode(CountryCode.MC) - .bankCode("11222") - .branchCode("00001") - .accountNumber("01234567890") - .nationalCheckDigit("30") - .build(), "MC5811222000010123456789030"}, - {new Iban.Builder() - .countryCode(CountryCode.ME) - .bankCode("505") - .accountNumber("0000123456789") - .nationalCheckDigit("51") - .build(), "ME25505000012345678951"}, - {new Iban.Builder() - .countryCode(CountryCode.MQ) - .bankCode("12345") - .branchCode("12345") - .accountNumber("123456789AB") - .nationalCheckDigit("13") - .build(), "MQ221234512345123456789AB13"}, - {new Iban.Builder() - .countryCode(CountryCode.NC) - .bankCode("12345") - .branchCode("12345") - .accountNumber("123456789AB") - .nationalCheckDigit("13") - .build(), "NC551234512345123456789AB13"}, - {new Iban.Builder() - .countryCode(CountryCode.NL) - .bankCode("ABNA") - .accountNumber("0417164300") - .build(), "NL91ABNA0417164300"}, - {new Iban.Builder() - .countryCode(CountryCode.NO) - .bankCode("8601") - .accountNumber("111794") - .nationalCheckDigit("7") - .build(), "NO9386011117947"}, - {new Iban.Builder() - .countryCode(CountryCode.PF) - .bankCode("12345") - .branchCode("12345") - .accountNumber("123456789AB") - .nationalCheckDigit("13") - .build(), "PF281234512345123456789AB13"}, - {new Iban.Builder() - .countryCode(CountryCode.PK) - .bankCode("SCBL") - .accountNumber("0000001123456702") - .build(), "PK36SCBL0000001123456702"}, - {new Iban.Builder() - .countryCode(CountryCode.PM) - .bankCode("12345") - .branchCode("12345") - .accountNumber("123456789AB") - .nationalCheckDigit("13") - .build(), "PM071234512345123456789AB13"}, - {new Iban.Builder() - .countryCode(CountryCode.PS) - .bankCode("PALS") - .accountNumber("000000000400123456702") - .build(), "PS92PALS000000000400123456702"}, - {new Iban.Builder() - .countryCode(CountryCode.PL) - .bankCode("109") - .branchCode("0101") - .accountNumber("0000071219812874") - .nationalCheckDigit("4") - .build(), "PL61109010140000071219812874"}, - {new Iban.Builder() - .countryCode(CountryCode.PT) - .bankCode("0002") - .branchCode("0123") - .accountNumber("12345678901") - .nationalCheckDigit("54") - .build(), "PT50000201231234567890154"}, - {new Iban.Builder() - .countryCode(CountryCode.RE) - .bankCode("12345") - .branchCode("12345") - .accountNumber("123456789AB") - .nationalCheckDigit("13") - .build(), "RE131234512345123456789AB13"}, - {new Iban.Builder() - .countryCode(CountryCode.RO) - .bankCode("AAAA") - .accountNumber("1B31007593840000") - .build(), "RO49AAAA1B31007593840000"}, - {new Iban.Builder() - .countryCode(CountryCode.QA) - .bankCode("DOHB") - .accountNumber("00001234567890ABCDEFG") - .build(), "QA58DOHB00001234567890ABCDEFG"}, - {new Iban.Builder() - .countryCode(CountryCode.SC) - .bankCode("SSCB") - .branchCode("1101") - .accountNumber("0000000000001497") - .accountType("USD") - .build(), "SC18SSCB11010000000000001497USD"}, - {new Iban.Builder() - .countryCode(CountryCode.SM) - .bankCode("03225") - .branchCode("09800") - .accountNumber("000000270100") - .nationalCheckDigit("U") - .build(), "SM86U0322509800000000270100"}, - {new Iban.Builder() - .countryCode(CountryCode.ST) - .bankCode("0001") - .branchCode("0001") - .accountNumber("0051845310112") - .build(), "ST68000100010051845310112"}, - {new Iban.Builder() - .countryCode(CountryCode.SA) - .bankCode("80") - .accountNumber("000000608010167519") - .build(), "SA0380000000608010167519"}, - {new Iban.Builder() - .countryCode(CountryCode.RS) - .bankCode("260") - .branchCode("26") - .accountNumber("0056010016113") - .nationalCheckDigit("79") - .build(), "RS35260005601001611379"}, - {new Iban.Builder() - .countryCode(CountryCode.RU) - .bankCode("044525600") - .branchCode("40702") - .accountNumber("810412345678901") - .build(), "RU0204452560040702810412345678901"}, - {new Iban.Builder() - .countryCode(CountryCode.SK) - .bankCode("1200") - .accountNumber("0000198742637541") - .build(), "SK3112000000198742637541"}, - {new Iban.Builder() - .countryCode(CountryCode.SV) - .bankCode("CENR") - .accountNumber("00000000000000700025") - .build(), "SV62CENR00000000000000700025"}, - {new Iban.Builder() - .countryCode(CountryCode.SI) - .bankCode("26") - .branchCode("330") - .accountNumber("00120390") - .nationalCheckDigit("86") - .build(), "SI56263300012039086"}, - {new Iban.Builder() - .countryCode(CountryCode.ES) - .bankCode("2100") - .branchCode("0418") - .accountNumber("0200051332") - .nationalCheckDigit("45") - .build(), "ES9121000418450200051332"}, - {new Iban.Builder() - .countryCode(CountryCode.SE) - .bankCode("500") - .accountNumber("00000058398257466") - .build(), "SE4550000000058398257466"}, - {new Iban.Builder() - .countryCode(CountryCode.CH) - .bankCode("00762") - .accountNumber("011623852957") - .build(), "CH9300762011623852957"}, - {new Iban.Builder() - .countryCode(CountryCode.TF) - .bankCode("12345") - .branchCode("12345") - .accountNumber("123456789AB") - .nationalCheckDigit("13") - .build(), "TF891234512345123456789AB13"}, - {new Iban.Builder() - .countryCode(CountryCode.TN) - .bankCode("10") - .branchCode("006") - .accountNumber("035183598478831") - .build(), "TN5910006035183598478831"}, - {new Iban.Builder() - .countryCode(CountryCode.TR) - .bankCode("00061") - .accountNumber("0519786457841326") - .nationalCheckDigit("0") - .build(), "TR330006100519786457841326"}, - {new Iban.Builder() - .countryCode(CountryCode.AE) - .bankCode("033") - .accountNumber("1234567890123456") - .build(), "AE070331234567890123456"}, - {new Iban.Builder() - .countryCode(CountryCode.GB) - .bankCode("NWBK") - .branchCode("601613") - .accountNumber("31926819") - .build(), "GB29NWBK60161331926819"}, - {new Iban.Builder() - .countryCode(CountryCode.IM) - .bankCode("HBUK") - .branchCode("401276") - .accountNumber("12345678") - .build(), "IM20HBUK40127612345678"}, - {new Iban.Builder() - .countryCode(CountryCode.GG) - .bankCode("INGB") - .branchCode("238859") - .accountNumber("12345678") - .build(), "GG65INGB23885912345678"}, - {new Iban.Builder() - .countryCode(CountryCode.JE) - .bankCode("DEUT") - .branchCode("405081") - .accountNumber("12345678") - .build(), "JE51DEUT40508112345678"}, - {new Iban.Builder() - .countryCode(CountryCode.VA) - .bankCode("001") - .accountNumber("123000012345678") - .build(), "VA59001123000012345678"}, - {new Iban.Builder() - .countryCode(CountryCode.VG) - .bankCode("VPVG") - .accountNumber("0000012345678901") - .build(), "VG96VPVG0000012345678901"}, - {new Iban.Builder() - .countryCode(CountryCode.TL) - .bankCode("008") - .accountNumber("00123456789101") - .nationalCheckDigit("57") - .build(), "TL380080012345678910157"}, - {new Iban.Builder() - .countryCode(CountryCode.WF) - .bankCode("12345") - .branchCode("12345") - .accountNumber("123456789AB") - .nationalCheckDigit("13") - .build(), "WF621234512345123456789AB13"}, - {new Iban.Builder() - .countryCode(CountryCode.XK) - .bankCode("10") - .branchCode("00") - .accountNumber("0000000000") - .nationalCheckDigit("53") - .build(), "XK051000000000000053"}, - {new Iban.Builder() - .countryCode(CountryCode.IR) - .bankCode("017") - .accountNumber("0000000000123456789") - .build(), "IR200170000000000123456789"}, - {new Iban.Builder() - .countryCode(CountryCode.FO) - .bankCode("5432") - .accountNumber("038889994") - .nationalCheckDigit("4") - .build(), "FO9754320388899944"}, - {new Iban.Builder() - .countryCode(CountryCode.GL) - .bankCode("6471") - .accountNumber("0001000206") - .build(), "GL8964710001000206"}, - {new Iban.Builder() - .countryCode(CountryCode.UA) - .bankCode("354347") - .accountNumber("0006762462054925026") - .build(), "UA573543470006762462054925026"}, - {new Iban.Builder() - .countryCode(CountryCode.YT) - .bankCode("12345") - .branchCode("12345") - .accountNumber("123456789AB") - .nationalCheckDigit("13") - .build(), "YT021234512345123456789AB13"}, - {new Iban.Builder() - .countryCode(CountryCode.IQ) - .bankCode("NBIQ") - .branchCode("850") - .accountNumber("123456789012") - .build(), "IQ98NBIQ850123456789012"}, - {new Iban.Builder() - .countryCode(CountryCode.GA) - .bankCode("40001") - .branchCode("09080") - .accountNumber("0008120005890") - .build(), "GA2140001090800008120005890"}, - {new Iban.Builder() - .countryCode(CountryCode.CV) - .bankCode("0002") - .branchCode("0000") - .accountNumber("0311180710148").build(), "CV64000200000311180710148" }, { new Iban.Builder().countryCode(CountryCode.OM) - .bankCode("028") - .accountNumber("12345678901") - .leftPadding(true).build(), "OM040280000012345678901" } + public static Collection getIbanData() { + return Arrays.asList( + new Object[][] { + { + new Iban.Builder() + .countryCode(CountryCode.AL) + .bankCode("212") + .branchCode("1100") + .accountNumber("0000000235698741") + .nationalCheckDigit("9") + .build(), + "AL47212110090000000235698741" + }, + { + new Iban.Builder() + .countryCode(CountryCode.AD) + .bankCode("0001") + .branchCode("2030") + .accountNumber("200359100100") + .build(), + "AD1200012030200359100100" + }, + { + new Iban.Builder() + .countryCode(CountryCode.AO) + .bankCode("0006") + .branchCode("0000") + .accountNumber("53518203301") + .nationalCheckDigit("69") + .build(), + "AO06000600005351820330169" + }, + { + new Iban.Builder() + .countryCode(CountryCode.AT) + .bankCode("19043") + .accountNumber("00234573201") + .build(), + "AT611904300234573201" + }, + { + new Iban.Builder() + .countryCode(CountryCode.AZ) + .bankCode("NABZ") + .accountNumber("00000000137010001944") + .build(), + "AZ21NABZ00000000137010001944" + }, + { + new Iban.Builder() + .countryCode(CountryCode.BH) + .bankCode("SCBL") + .accountNumber("BHD18903608801") + .build(), + "BH72SCBLBHD18903608801" + }, + { + new Iban.Builder() + .countryCode(CountryCode.BE) + .bankCode("539") + .accountNumber("0075470") + .nationalCheckDigit("34") + .build(), + "BE68539007547034" + }, + { + new Iban.Builder() + .countryCode(CountryCode.BA) + .bankCode("129") + .branchCode("007") + .accountNumber("94010284") + .nationalCheckDigit("94") + .build(), + "BA391290079401028494" + }, + { + new Iban.Builder() + .countryCode(CountryCode.BR) + .bankCode("00360305") + .branchCode("00001") + .accountNumber("0009795493") + .accountType("P") + .ownerAccountType("1") + .build(), + "BR9700360305000010009795493P1" + }, + { + new Iban.Builder() + .countryCode(CountryCode.BG) + .bankCode("BNBG") + .branchCode("9661") + .accountNumber("20345678") + .accountType("10") + .build(), + "BG80BNBG96611020345678" + }, + { + new Iban.Builder() + .countryCode(CountryCode.BL) + .bankCode("12345") + .branchCode("12345") + .accountNumber("123456789AB") + .nationalCheckDigit("13") + .build(), + "BL391234512345123456789AB13" + }, + { + new Iban.Builder() + .countryCode(CountryCode.BY) + .bankCode("NBRB") + .branchCode("3600") + .accountNumber("900000002Z00AB00") + .build(), + "BY13NBRB3600900000002Z00AB00" + }, + { + new Iban.Builder() + .countryCode(CountryCode.CR) + .bankCode("0152") + .accountNumber("02001026284066") + .build(), + "CR05015202001026284066" + }, + { + new Iban.Builder() + .countryCode(CountryCode.HR) + .bankCode("1001005") + .accountNumber("1863000160") + .build(), + "HR1210010051863000160" + }, + { + new Iban.Builder() + .countryCode(CountryCode.CY) + .bankCode("002") + .branchCode("00128") + .accountNumber("0000001200527600") + .build(), + "CY17002001280000001200527600" + }, + { + new Iban.Builder() + .countryCode(CountryCode.CZ) + .bankCode("0800") + .accountNumber("0000192000145399") + .build(), + "CZ6508000000192000145399" + }, + { + new Iban.Builder() + .countryCode(CountryCode.DK) + .bankCode("0040") + .accountNumber("0440116243") + .build(), + "DK5000400440116243" + }, + { + new Iban.Builder() + .countryCode(CountryCode.DO) + .bankCode("BAGR") + .accountNumber("00000001212453611324") + .build(), + "DO28BAGR00000001212453611324" + }, + { + new Iban.Builder() + .countryCode(CountryCode.EE) + .bankCode("22") + .branchCode("00") + .accountNumber("22102014568") + .nationalCheckDigit("5") + .build(), + "EE382200221020145685" + }, + { + new Iban.Builder() + .countryCode(CountryCode.EG) + .bankCode("0019") + .branchCode("0005") + .accountNumber("00000000263180002") + .build(), + "EG380019000500000000263180002" + }, + { + new Iban.Builder() + .countryCode(CountryCode.FI) + .bankCode("123456") + .accountNumber("0000078") + .nationalCheckDigit("5") + .build(), + "FI2112345600000785" + }, + { + new Iban.Builder() + .countryCode(CountryCode.AX) + .bankCode("987654") + .accountNumber("0002033") + .nationalCheckDigit("5") + .build(), + "AX7898765400020335" + }, + { + new Iban.Builder() + .countryCode(CountryCode.FR) + .bankCode("20041") + .branchCode("01005") + .accountNumber("0500013M026") + .nationalCheckDigit("06") + .build(), + "FR1420041010050500013M02606" + }, + { + new Iban.Builder() + .countryCode(CountryCode.GE) + .bankCode("NB") + .accountNumber("0000000101904917") + .build(), + "GE29NB0000000101904917" + }, + { + new Iban.Builder() + .countryCode(CountryCode.GF) + .bankCode("12345") + .branchCode("12345") + .accountNumber("123456789AB") + .nationalCheckDigit("13") + .build(), + "GF121234512345123456789AB13" + }, + { + new Iban.Builder() + .countryCode(CountryCode.DE) + .bankCode("37040044") + .accountNumber("0532013000") + .build(), + "DE89370400440532013000" + }, + { + new Iban.Builder() + .countryCode(CountryCode.GI) + .bankCode("NWBK") + .accountNumber("000000007099453") + .build(), + "GI75NWBK000000007099453" + }, + { + new Iban.Builder() + .countryCode(CountryCode.GP) + .bankCode("12345") + .branchCode("12345") + .accountNumber("123456789AB") + .nationalCheckDigit("13") + .build(), + "GP791234512345123456789AB13" + }, + { + new Iban.Builder() + .countryCode(CountryCode.GR) + .bankCode("011") + .branchCode("0125") + .accountNumber("0000000012300695") + .build(), + "GR1601101250000000012300695" + }, + { + new Iban.Builder() + .countryCode(CountryCode.GT) + .bankCode("TRAJ") + .accountNumber("01020000001210029690") + .build(), + "GT82TRAJ01020000001210029690" + }, + { + new Iban.Builder() + .countryCode(CountryCode.HU) + .bankCode("117") + .branchCode("7301") + .accountNumber("6111110180000000") + .nationalCheckDigit("0") + .build(), + "HU42117730161111101800000000" + }, + { + new Iban.Builder() + .countryCode(CountryCode.IS) + .bankCode("01") + .branchCode("59") + .accountType("26") + .accountNumber("007654") + .identificationNumber("5510730339") + .build(), + "IS140159260076545510730339" + }, + { + new Iban.Builder() + .countryCode(CountryCode.IE) + .bankCode("AIBK") + .branchCode("931152") + .accountNumber("12345678") + .build(), + "IE29AIBK93115212345678" + }, + { + new Iban.Builder() + .countryCode(CountryCode.IL) + .bankCode("010") + .branchCode("800") + .accountNumber("0000099999999") + .build(), + "IL620108000000099999999" + }, + { + new Iban.Builder() + .countryCode(CountryCode.IT) + .bankCode("05428") + .branchCode("11101") + .nationalCheckDigit("X") + .accountNumber("000000123456") + .build(), + "IT60X0542811101000000123456" + }, + { + new Iban.Builder() + .countryCode(CountryCode.JO) + .bankCode("CBJO") + .branchCode("0010") + .accountNumber("000000000131000302") + .build(), + "JO94CBJO0010000000000131000302" + }, + { + new Iban.Builder() + .countryCode(CountryCode.KZ) + .bankCode("125") + .accountNumber("KZT5004100100") + .build(), + "KZ86125KZT5004100100" + }, + { + new Iban.Builder() + .countryCode(CountryCode.KW) + .bankCode("CBKU") + .accountNumber("0000000000001234560101") + .build(), + "KW81CBKU0000000000001234560101" + }, + { + new Iban.Builder() + .countryCode(CountryCode.LC) + .bankCode("HEMM") + .accountNumber("000100010012001200023015") + .build(), + "LC55HEMM000100010012001200023015" + }, + { + new Iban.Builder() + .countryCode(CountryCode.LV) + .bankCode("BANK") + .accountNumber("0000435195001") + .build(), + "LV80BANK0000435195001" + }, + { + new Iban.Builder() + .countryCode(CountryCode.LB) + .bankCode("0999") + .accountNumber("00000001001901229114") + .build(), + "LB62099900000001001901229114" + }, + { + new Iban.Builder() + .countryCode(CountryCode.LI) + .bankCode("08810") + .accountNumber("0002324013AA") + .build(), + "LI21088100002324013AA" + }, + { + new Iban.Builder() + .countryCode(CountryCode.LT) + .bankCode("10000") + .accountNumber("11101001000") + .build(), + "LT121000011101001000" + }, + { + new Iban.Builder() + .countryCode(CountryCode.LU) + .bankCode("001") + .accountNumber("9400644750000") + .build(), + "LU280019400644750000" + }, + { + new Iban.Builder() + .countryCode(CountryCode.MF) + .bankCode("12345") + .branchCode("12345") + .accountNumber("123456789AB") + .nationalCheckDigit("13") + .build(), + "MF551234512345123456789AB13" + }, + { + new Iban.Builder() + .countryCode(CountryCode.MK) + .bankCode("250") + .accountNumber("1200000589") + .nationalCheckDigit("84") + .build(), + "MK07250120000058984" + }, + { + new Iban.Builder() + .countryCode(CountryCode.MT) + .bankCode("MALT") + .branchCode("01100") + .accountNumber("0012345MTLCAST001S") + .build(), + "MT84MALT011000012345MTLCAST001S" + }, + { + new Iban.Builder() + .countryCode(CountryCode.MR) + .bankCode("00020") + .branchCode("00101") + .accountNumber("00001234567") + .nationalCheckDigit("53") + .build(), + "MR1300020001010000123456753" + }, + { + new Iban.Builder() + .countryCode(CountryCode.MU) + .bankCode("BOMM01") + .branchCode("01") + .accountNumber("101030300200000MUR") + .build(), + "MU17BOMM0101101030300200000MUR" + }, + { + new Iban.Builder() + .countryCode(CountryCode.MD) + .bankCode("AG") + .accountNumber("000225100013104168") + .build(), + "MD24AG000225100013104168" + }, + { + new Iban.Builder() + .countryCode(CountryCode.MC) + .bankCode("11222") + .branchCode("00001") + .accountNumber("01234567890") + .nationalCheckDigit("30") + .build(), + "MC5811222000010123456789030" + }, + { + new Iban.Builder() + .countryCode(CountryCode.ME) + .bankCode("505") + .accountNumber("0000123456789") + .nationalCheckDigit("51") + .build(), + "ME25505000012345678951" + }, + { + new Iban.Builder() + .countryCode(CountryCode.MQ) + .bankCode("12345") + .branchCode("12345") + .accountNumber("123456789AB") + .nationalCheckDigit("13") + .build(), + "MQ221234512345123456789AB13" + }, + { + new Iban.Builder() + .countryCode(CountryCode.NC) + .bankCode("12345") + .branchCode("12345") + .accountNumber("123456789AB") + .nationalCheckDigit("13") + .build(), + "NC551234512345123456789AB13" + }, + { + new Iban.Builder() + .countryCode(CountryCode.NL) + .bankCode("ABNA") + .accountNumber("0417164300") + .build(), + "NL91ABNA0417164300" + }, + { + new Iban.Builder() + .countryCode(CountryCode.NO) + .bankCode("8601") + .accountNumber("111794") + .nationalCheckDigit("7") + .build(), + "NO9386011117947" + }, + { + new Iban.Builder() + .countryCode(CountryCode.PF) + .bankCode("12345") + .branchCode("12345") + .accountNumber("123456789AB") + .nationalCheckDigit("13") + .build(), + "PF281234512345123456789AB13" + }, + { + new Iban.Builder() + .countryCode(CountryCode.PK) + .bankCode("SCBL") + .accountNumber("0000001123456702") + .build(), + "PK36SCBL0000001123456702" + }, + { + new Iban.Builder() + .countryCode(CountryCode.PM) + .bankCode("12345") + .branchCode("12345") + .accountNumber("123456789AB") + .nationalCheckDigit("13") + .build(), + "PM071234512345123456789AB13" + }, + { + new Iban.Builder() + .countryCode(CountryCode.PS) + .bankCode("PALS") + .accountNumber("000000000400123456702") + .build(), + "PS92PALS000000000400123456702" + }, + { + new Iban.Builder() + .countryCode(CountryCode.PL) + .bankCode("109") + .branchCode("0101") + .accountNumber("0000071219812874") + .nationalCheckDigit("4") + .build(), + "PL61109010140000071219812874" + }, + { + new Iban.Builder() + .countryCode(CountryCode.PT) + .bankCode("0002") + .branchCode("0123") + .accountNumber("12345678901") + .nationalCheckDigit("54") + .build(), + "PT50000201231234567890154" + }, + { + new Iban.Builder() + .countryCode(CountryCode.RE) + .bankCode("12345") + .branchCode("12345") + .accountNumber("123456789AB") + .nationalCheckDigit("13") + .build(), + "RE131234512345123456789AB13" + }, + { + new Iban.Builder() + .countryCode(CountryCode.RO) + .bankCode("AAAA") + .accountNumber("1B31007593840000") + .build(), + "RO49AAAA1B31007593840000" + }, + { + new Iban.Builder() + .countryCode(CountryCode.QA) + .bankCode("DOHB") + .accountNumber("00001234567890ABCDEFG") + .build(), + "QA58DOHB00001234567890ABCDEFG" + }, + { + new Iban.Builder() + .countryCode(CountryCode.SC) + .bankCode("SSCB") + .branchCode("1101") + .accountNumber("0000000000001497") + .accountType("USD") + .build(), + "SC18SSCB11010000000000001497USD" + }, + { + new Iban.Builder() + .countryCode(CountryCode.SM) + .bankCode("03225") + .branchCode("09800") + .accountNumber("000000270100") + .nationalCheckDigit("U") + .build(), + "SM86U0322509800000000270100" + }, + { + new Iban.Builder() + .countryCode(CountryCode.ST) + .bankCode("0001") + .branchCode("0001") + .accountNumber("0051845310112") + .build(), + "ST68000100010051845310112" + }, + { + new Iban.Builder() + .countryCode(CountryCode.SA) + .bankCode("80") + .accountNumber("000000608010167519") + .build(), + "SA0380000000608010167519" + }, + { + new Iban.Builder() + .countryCode(CountryCode.RS) + .bankCode("260") + .branchCode("26") + .accountNumber("0056010016113") + .nationalCheckDigit("79") + .build(), + "RS35260005601001611379" + }, + { + new Iban.Builder() + .countryCode(CountryCode.RU) + .bankCode("044525600") + .branchCode("40702") + .accountNumber("810412345678901") + .build(), + "RU0204452560040702810412345678901" + }, + { + new Iban.Builder() + .countryCode(CountryCode.SK) + .bankCode("1200") + .accountNumber("0000198742637541") + .build(), + "SK3112000000198742637541" + }, + { + new Iban.Builder() + .countryCode(CountryCode.SV) + .bankCode("CENR") + .accountNumber("00000000000000700025") + .build(), + "SV62CENR00000000000000700025" + }, + { + new Iban.Builder() + .countryCode(CountryCode.SI) + .bankCode("26") + .branchCode("330") + .accountNumber("00120390") + .nationalCheckDigit("86") + .build(), + "SI56263300012039086" + }, + { + new Iban.Builder() + .countryCode(CountryCode.ES) + .bankCode("2100") + .branchCode("0418") + .accountNumber("0200051332") + .nationalCheckDigit("45") + .build(), + "ES9121000418450200051332" + }, + { + new Iban.Builder() + .countryCode(CountryCode.SE) + .bankCode("500") + .accountNumber("00000058398257466") + .build(), + "SE4550000000058398257466" + }, + { + new Iban.Builder() + .countryCode(CountryCode.CH) + .bankCode("00762") + .accountNumber("011623852957") + .build(), + "CH9300762011623852957" + }, + { + new Iban.Builder() + .countryCode(CountryCode.TF) + .bankCode("12345") + .branchCode("12345") + .accountNumber("123456789AB") + .nationalCheckDigit("13") + .build(), + "TF891234512345123456789AB13" + }, + { + new Iban.Builder() + .countryCode(CountryCode.TN) + .bankCode("10") + .branchCode("006") + .accountNumber("035183598478831") + .build(), + "TN5910006035183598478831" + }, + { + new Iban.Builder() + .countryCode(CountryCode.TR) + .bankCode("00061") + .accountNumber("0519786457841326") + .nationalCheckDigit("0") + .build(), + "TR330006100519786457841326" + }, + { + new Iban.Builder() + .countryCode(CountryCode.AE) + .bankCode("033") + .accountNumber("1234567890123456") + .build(), + "AE070331234567890123456" + }, + { + new Iban.Builder() + .countryCode(CountryCode.GB) + .bankCode("NWBK") + .branchCode("601613") + .accountNumber("31926819") + .build(), + "GB29NWBK60161331926819" + }, + { + new Iban.Builder() + .countryCode(CountryCode.IM) + .bankCode("HBUK") + .branchCode("401276") + .accountNumber("12345678") + .build(), + "IM20HBUK40127612345678" + }, + { + new Iban.Builder() + .countryCode(CountryCode.GG) + .bankCode("INGB") + .branchCode("238859") + .accountNumber("12345678") + .build(), + "GG65INGB23885912345678" + }, + { + new Iban.Builder() + .countryCode(CountryCode.JE) + .bankCode("DEUT") + .branchCode("405081") + .accountNumber("12345678") + .build(), + "JE51DEUT40508112345678" + }, + { + new Iban.Builder() + .countryCode(CountryCode.VA) + .bankCode("001") + .accountNumber("123000012345678") + .build(), + "VA59001123000012345678" + }, + { + new Iban.Builder() + .countryCode(CountryCode.VG) + .bankCode("VPVG") + .accountNumber("0000012345678901") + .build(), + "VG96VPVG0000012345678901" + }, + { + new Iban.Builder() + .countryCode(CountryCode.TL) + .bankCode("008") + .accountNumber("00123456789101") + .nationalCheckDigit("57") + .build(), + "TL380080012345678910157" + }, + { + new Iban.Builder() + .countryCode(CountryCode.WF) + .bankCode("12345") + .branchCode("12345") + .accountNumber("123456789AB") + .nationalCheckDigit("13") + .build(), + "WF621234512345123456789AB13" + }, + { + new Iban.Builder() + .countryCode(CountryCode.XK) + .bankCode("10") + .branchCode("00") + .accountNumber("0000000000") + .nationalCheckDigit("53") + .build(), + "XK051000000000000053" + }, + { + new Iban.Builder() + .countryCode(CountryCode.IR) + .bankCode("017") + .accountNumber("0000000000123456789") + .build(), + "IR200170000000000123456789" + }, + { + new Iban.Builder() + .countryCode(CountryCode.FO) + .bankCode("5432") + .accountNumber("038889994") + .nationalCheckDigit("4") + .build(), + "FO9754320388899944" + }, + { + new Iban.Builder() + .countryCode(CountryCode.GL) + .bankCode("6471") + .accountNumber("0001000206") + .build(), + "GL8964710001000206" + }, + { + new Iban.Builder() + .countryCode(CountryCode.UA) + .bankCode("354347") + .accountNumber("0006762462054925026") + .build(), + "UA573543470006762462054925026" + }, + { + new Iban.Builder() + .countryCode(CountryCode.YT) + .bankCode("12345") + .branchCode("12345") + .accountNumber("123456789AB") + .nationalCheckDigit("13") + .build(), + "YT021234512345123456789AB13" + }, + { + new Iban.Builder() + .countryCode(CountryCode.IQ) + .bankCode("NBIQ") + .branchCode("850") + .accountNumber("123456789012") + .build(), + "IQ98NBIQ850123456789012" + }, + { + new Iban.Builder() + .countryCode(CountryCode.GA) + .bankCode("40001") + .branchCode("09080") + .accountNumber("0008120005890") + .build(), + "GA2140001090800008120005890" + }, + { + new Iban.Builder() + .countryCode(CountryCode.CV) + .bankCode("0002") + .branchCode("0000") + .accountNumber("0311180710148") + .build(), + "CV64000200000311180710148" + }, + { + new Iban.Builder() + .countryCode(CountryCode.OM) + .bankCode("028") + .accountNumber("12345678901") + .leftPadding(true) + .build(), + "OM040280000012345678901" + }, + { + new Iban.Builder() + .countryCode(CountryCode.BI) + .bankCode("10000") + .branchCode("10001") + .accountNumber("0000332045181") + .build(), + "BI4210000100010000332045181" + } }); - } + } - public static Collection getBicData() { - return Arrays.asList(new Object[][]{ - {"DEUTDEFF"}, - {"DEUTDEFF500"}, - {"NEDSZAJJXXX"}, - {"DABADKKK"}, - {"UNCRIT2B912"}, - {"DSBACNBXSHA"}, - {"BNORPHMM"} + public static Collection getBicData() { + return Arrays.asList( + new Object[][] { + {"DEUTDEFF"}, + {"DEUTDEFF500"}, + {"NEDSZAJJXXX"}, + {"DABADKKK"}, + {"UNCRIT2B912"}, + {"DSBACNBXSHA"}, + {"BNORPHMM"} }); - } - + } }