Class IBANFields
This class uses the JDK8 Optional API to express fields that are not present in every country's IBAN
format. If you're on a lower JDK level (like on Android), use IBANFieldsCompat for a version that returns
nulls.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetBankIdentifier(IBAN iban) Returns the bank identifier from the given IBAN, if available.getBranchIdentifier(IBAN iban) Returns the branch identifier from the given IBAN, if available.
-
Method Details
-
getBankIdentifier
Returns the bank identifier from the given IBAN, if available.Finland (FI): The spec mentions both "Not in use" and "Position 1-3 indicate the bank or banking group." I have taken "bank or banking group" to be more or less synonymous with Bank Identifier and return it as such.
Slovenia (SI): The five digits following the checksum encode the financial institution and sub-encode the branch identifier if applicable, depending on the type of financial institution. The library returns all five digits as the bank identifier and never returns a branch identifier.
Republic of Kosovo (XK): The four digits following the checksum encode the Bank ID, and the last two of these four sub-encode the branch ID. The library returns all four digits as the bank identifier. For example: if the IBAN has "1234" in these positions, then the bank identifier is returned as "1234" and the branch identifier as "34".
- Parameters:
iban- an iban to evaluate. Cannot be null.- Returns:
- the bank ID for this IBAN, or
EMPTYif unknown.
-
getBranchIdentifier
Returns the branch identifier from the given IBAN, if available.- Parameters:
iban- an iban to evaluate. Cannot be null.- Returns:
- the branch ID for this IBAN, or
EMPTYif unknown.
-