Class AbstractIbanUtil
java.lang.Object
de.knightsoftnet.validators.shared.util.AbstractIbanUtil
- All Implemented Interfaces:
BankConstantsProvider,HasSetBankAccountBicSharedConstants,HasSetIbanLengthMapSharedConstants
- Direct Known Subclasses:
IbanUtil
public abstract class AbstractIbanUtil
extends Object
implements BankConstantsProvider, HasSetIbanLengthMapSharedConstants, HasSetBankAccountBicSharedConstants
Iban Util, format and compress ibans.
- Author:
- Manfred Tremmel
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intstatic final charcharacter used for separating blocks. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractIbanUtil(BankConstantsProvider bankConstantsProvider) constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetAccountNumberOfIban(String pstring) get account number of iban.getBankNumberOfIban(String pstring) get bank number of iban.getBicOfIban(String pstring) get bic of iban.static CountryEnumgetCountryOfIban(String pstring) get country of iban.static StringibanCompress(String pstring) compress iban, remove all blanks inside.static StringibanFormat(String pstring) format iban to four character blocks.static ValueWithPos<String>ibanFormatWithPos(ValueWithPos<String> pentry) format iban to four character blocks.voidsetBankAccountBicSharedConstants(BankAccountBicSharedConstants bankAccountBicSharedConstants) setter for bank account bic shared constants.voidset bank account bic constants when they are available.voidset bank account bic map when it is available.voidsetIbanLengthMapSharedConstants(IbanLengthMapSharedConstants ibanLengthMapSharedConstants) setter for iban length shared constants.voidset iban length definitions when they are available.
-
Field Details
-
SEPARATOR
public static final char SEPARATORcharacter used for separating blocks.- See Also:
-
BLOCK_LENGTH
protected static final int BLOCK_LENGTH- See Also:
-
-
Constructor Details
-
Method Details
-
ibanFormat
format iban to four character blocks.- Parameters:
pstring- string to format- Returns:
- formated string
-
ibanCompress
compress iban, remove all blanks inside.- Parameters:
pstring- string to compress- Returns:
- iban without spaces
-
getCountryOfIban
get country of iban.- Parameters:
pstring- string with iban- Returns:
- country
-
getBankNumberOfIban
get bank number of iban.- Parameters:
pstring- string with iban- Returns:
- bank number
-
getAccountNumberOfIban
get account number of iban.- Parameters:
pstring- string with iban- Returns:
- account number
-
getBicOfIban
get bic of iban.- Parameters:
pstring- string with iban- Returns:
- bic