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
Fields Modifier and Type Field Description protected static intBLOCK_LENGTHstatic charSEPARATORcharacter used for separating blocks.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractIbanUtil(BankConstantsProvider bankConstantsProvider)constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAccountNumberOfIban(String pstring)get account number of iban.StringgetBankNumberOfIban(String pstring)get bank number of iban.StringgetBicOfIban(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.voidsetBankAccountBicSharedConstantsWhenAvailable(HasSetBankAccountBicSharedConstants preceiver)set bank account bic constants when they are available.voidsetBicMapSharedConstantsWhenAvailable(HasSetBicMapSharedConstants preceiver)set bank account bic map when it is available.voidsetIbanLengthMapSharedConstants(IbanLengthMapSharedConstants ibanLengthMapSharedConstants)setter for iban length shared constants.voidsetIbanLengthMapSharedConstantsWhenAvailable(HasSetIbanLengthMapSharedConstants preceiver)set iban length definitions when they are available.
-
-
-
Field Detail
-
SEPARATOR
public static final char SEPARATOR
character used for separating blocks.- See Also:
- Constant Field Values
-
BLOCK_LENGTH
protected static final int BLOCK_LENGTH
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractIbanUtil
protected AbstractIbanUtil(BankConstantsProvider bankConstantsProvider)
constructor.- Parameters:
bankConstantsProvider- provider for bank account stuff
-
-
Method Detail
-
setBankAccountBicSharedConstants
public void setBankAccountBicSharedConstants(BankAccountBicSharedConstants bankAccountBicSharedConstants)
Description copied from interface:HasSetBankAccountBicSharedConstantssetter for bank account bic shared constants.- Specified by:
setBankAccountBicSharedConstantsin interfaceHasSetBankAccountBicSharedConstants- Parameters:
bankAccountBicSharedConstants- value to set
-
setIbanLengthMapSharedConstants
public void setIbanLengthMapSharedConstants(IbanLengthMapSharedConstants ibanLengthMapSharedConstants)
Description copied from interface:HasSetIbanLengthMapSharedConstantssetter for iban length shared constants.- Specified by:
setIbanLengthMapSharedConstantsin interfaceHasSetIbanLengthMapSharedConstants- Parameters:
ibanLengthMapSharedConstants- value to set
-
ibanFormatWithPos
public static ValueWithPos<String> ibanFormatWithPos(ValueWithPos<String> pentry)
format iban to four character blocks.- Parameters:
pentry- string to format and cursor position- Returns:
- formated string with new cursor position
-
ibanFormat
public static String ibanFormat(String pstring)
format iban to four character blocks.- Parameters:
pstring- string to format- Returns:
- formated string
-
ibanCompress
public static String ibanCompress(String pstring)
compress iban, remove all blanks inside.- Parameters:
pstring- string to compress- Returns:
- iban without spaces
-
getCountryOfIban
public static CountryEnum getCountryOfIban(String pstring)
get country of iban.- Parameters:
pstring- string with iban- Returns:
- country
-
getBankNumberOfIban
public String getBankNumberOfIban(String pstring)
get bank number of iban.- Parameters:
pstring- string with iban- Returns:
- bank number
-
getAccountNumberOfIban
public String getAccountNumberOfIban(String pstring)
get account number of iban.- Parameters:
pstring- string with iban- Returns:
- account number
-
getBicOfIban
public String getBicOfIban(String pstring)
get bic of iban.- Parameters:
pstring- string with iban- Returns:
- bic
-
setIbanLengthMapSharedConstantsWhenAvailable
public void setIbanLengthMapSharedConstantsWhenAvailable(HasSetIbanLengthMapSharedConstants preceiver)
Description copied from interface:BankConstantsProviderset iban length definitions when they are available.- Specified by:
setIbanLengthMapSharedConstantsWhenAvailablein interfaceBankConstantsProvider- Parameters:
preceiver- where to set data
-
setBankAccountBicSharedConstantsWhenAvailable
public void setBankAccountBicSharedConstantsWhenAvailable(HasSetBankAccountBicSharedConstants preceiver)
Description copied from interface:BankConstantsProviderset bank account bic constants when they are available.- Specified by:
setBankAccountBicSharedConstantsWhenAvailablein interfaceBankConstantsProvider- Parameters:
preceiver- where to set data
-
setBicMapSharedConstantsWhenAvailable
public void setBicMapSharedConstantsWhenAvailable(HasSetBicMapSharedConstants preceiver)
Description copied from interface:BankConstantsProviderset bank account bic map when it is available.- Specified by:
setBicMapSharedConstantsWhenAvailablein interfaceBankConstantsProvider- Parameters:
preceiver- where to set data
-
-