@Status(stage=DEVELOPMENT, unitTests=COMPLETE) @Review(by="Kees Schotanus", at="2009-09-28") @ThreadSafety(level=IMMUTABLE) public class InternationalBankAccountNumber extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
MSG_BBAN_FORMAT_IS_INCORRECT
Key to lookup: The BBAN's format is incorrect.
|
static String |
MSG_BBAN_IS_MANDATORY
Key to lookup: The BBAN is mandatory.
|
static String |
MSG_BBAN_IS_TOO_LONG
Key to lookup: The length of the BBAN is too long.
|
static String |
MSG_COUNTRY_DOES_NOT_EXIST
Key to lookup: The country does not exist.
|
static String |
MSG_COUNTRY_FORMAT_IS_INCORRECT
Key to lookup: The country's format (2 capital letters) is incorrect.
|
static String |
MSG_COUNTRY_IS_MANDATORY
Key to lookup: The country is mandatory.
|
static String |
MSG_COUNTRY_LENGTH_IS_INCORRECT
Key to lookup: The country's length is incorrect.
|
static String |
MSG_IBAN_CHECK_DIGITS_ARE_ILLEGAL
Key to lookup: IBAN has illegal check digits.
|
static String |
MSG_IBAN_CHECK_DIGITS_ARE_NOT_NUMERIC
Key to lookup: IBAN has non-numeric check digits.
|
static String |
MSG_IBAN_COUNTRY_DOES_NOT_EXIST
Key to lookup: IBAN has incorrect country.
|
static String |
MSG_IBAN_HAS_LOWER_CASE
Key to lookup: IBAN contains lower case letters.
|
static String |
MSG_IBAN_IS_NOT_ALPHA_NUMERIC
Key to lookup: IBAN contains non alpha numeric characters.
|
static String |
MSG_IBAN_IS_NULL_OR_EMPTY
Key to lookup: IBAN is null or empty.
|
static String |
MSG_IBAN_IS_TOO_LONG
Key to lookup: IBAN is too long.
|
static String |
MSG_IBAN_IS_TOO_SHORT
Key to lookup: IBAN is too short.
|
static String |
MSG_IBAN_NOT_MODULO_97
Key to lookup: IBAN does not pass modulo 97 check.
|
Constructor and Description |
---|
InternationalBankAccountNumber(String iban)
Constructs an IBAN object from the supplied iban String.
|
InternationalBankAccountNumber(String country,
String bban)
Constructs an IBAN object from the supplied country and bban (Basic Bank
Account Number).
|
Modifier and Type | Method and Description |
---|---|
static void |
checkBasicBankAccountNumber(String bban)
Checks that the supplied bban (Basic Bank Account Number) is valid.
|
static void |
checkCountry(String country)
Checks that the supplied country is valid.
|
static void |
checkIban(String iban)
Checks whether the supplied iban is valid.
|
String |
getBasicBankAccountNumber()
Gets the Basic Bank Account Number (BBAN) from this IBAN.
|
String |
getCheckDigits()
Gets the check digits from this IBAN.
|
String |
getCountry()
Gets the country from this IBAN.
|
static boolean |
isValidIban(String iban)
Checks whether the supplied iban is valid.
|
static void |
main(String[] args)
Simple test method.
|
String |
toPaperFormat()
Creates the paper format of this IBAN.
|
String |
toString()
Creates a String representation of this IBAN consisting of the IBAN
itself.
|
public static final String MSG_BBAN_IS_MANDATORY
public static final String MSG_BBAN_IS_TOO_LONG
public static final String MSG_BBAN_FORMAT_IS_INCORRECT
public static final String MSG_COUNTRY_IS_MANDATORY
public static final String MSG_COUNTRY_LENGTH_IS_INCORRECT
public static final String MSG_COUNTRY_FORMAT_IS_INCORRECT
public static final String MSG_COUNTRY_DOES_NOT_EXIST
public static final String MSG_IBAN_IS_NULL_OR_EMPTY
public static final String MSG_IBAN_IS_TOO_SHORT
public static final String MSG_IBAN_IS_TOO_LONG
public static final String MSG_IBAN_HAS_LOWER_CASE
public static final String MSG_IBAN_IS_NOT_ALPHA_NUMERIC
public static final String MSG_IBAN_COUNTRY_DOES_NOT_EXIST
public static final String MSG_IBAN_CHECK_DIGITS_ARE_NOT_NUMERIC
public static final String MSG_IBAN_CHECK_DIGITS_ARE_ILLEGAL
public static final String MSG_IBAN_NOT_MODULO_97
public InternationalBankAccountNumber(String iban) throws InvalidArgumentException
iban
- An International Bank Account Number.
InvalidArgumentException
- When the supplied iban does not contain
a valid IBAN.
checkIban(String)
for the definition of a valid IBAN.public InternationalBankAccountNumber(String country, String bban) throws InvalidArgumentException
country
- Two letter ISO-3166 country code.bban
- Basic Bank Account Number.InvalidArgumentException
- When the supplied country or the
supplied bban are not valid or when the combination does not form a
valid IBAN.
checkIban(String)
for the definition of a valid IBAN.public String getCountry()
public String getCheckDigits()
public String getBasicBankAccountNumber()
public static boolean isValidIban(String iban)
checkIban(String)
.iban
- The iban to check.public static void checkIban(String iban) throws InvalidArgumentException
iban
- The iban to check.InvalidArgumentException
- When the supplied iban is not valid.public static void checkCountry(String country) throws InvalidArgumentException
country
- The country to check.InvalidArgumentException
- When the supplied country is not a valid
ISO-3166 country code.public static void checkBasicBankAccountNumber(String bban) throws InvalidArgumentException
bban
- The Basic Bank Account Number to check.InvalidArgumentException
- When the supplied bban is not valid.public String toPaperFormat()
public String toString()
public static void main(String[] args) throws InvalidArgumentException
args
- Not used.InvalidArgumentException
- When one of the iban's is not valid.Copyright © 2008–2018. All rights reserved.