Package com.storedobject.common
Class IBAN
java.lang.Object
com.storedobject.common.IBAN
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringFormat an IBAN by inserting a space after every 4 positions from the left.static StringInsert check digits to the given set of IBAN fragments for a given country to generate a valid IBAN.static StringInsert check digits to the given set of IBAN fragments for a given country to generate a valid IBAN.static intGet length of IBAN.static intGet length of IBAN.static booleanValidate a given IBAN.
-
Constructor Details
-
IBAN
public IBAN()
-
-
Method Details
-
validate
Validate a given IBAN. (For certain countries, the valid length is already coded (Seelength(Country)) and for those countries length is also verified.)- Parameters:
iban- IBAN (It could be a formatted IBAN too).- Returns:
- True if valid.
-
length
Get length of IBAN.- Parameters:
country- Country- Returns:
- Length of IBAN for known countries. -1 is returned if unknown (or not yet coded here).
-2 is returned if
countryisnullor for invalid country code.
-
length
Get length of IBAN.- Parameters:
country- Country- Returns:
- Length of IBAN for known countries. -1 is returned if unknown (or not yet coded here).
-2 is returned if
countryisnull.
-
generate
Insert check digits to the given set of IBAN fragments for a given country to generate a valid IBAN.- Parameters:
country- CountryibanFragments- Fragment of the IBAN. If the length of the IBAN for the given country is known and the total length of the fragments given is smaller in size, then, the last fragment will be left-padded with zeros.- Returns:
- A valid IBAN. If the
countryisnullor if the total length of the IBAN fragments isnullor too long, null is returned.
-
generate
Insert check digits to the given set of IBAN fragments for a given country to generate a valid IBAN.- Parameters:
country- CountryibanFragments- Fragment of the IBAN. If the length of the IBAN for the given country is known and the total length of the fragments given is smaller in size, then, the last fragment will be left-padded with zeros.- Returns:
- A valid IBAN. If the
countryisnullor if the total length of the IBAN fragments isnullor too long, null is returned.
-
format
-