Class IBANFieldsCompat

java.lang.Object
nl.garvelink.iban.IBANFieldsCompat

public class IBANFieldsCompat extends Object
Extracts national encoded information from IBANs.

This class returns nulls to express fields that are not present in every country's IBAN format. If you're on JDK8, you may prefer IBANFields, which uses the Optional API.

  • Method Details

    • getBankIdentifier

      public static String getBankIdentifier(IBAN iban)
      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 null if unknown.
    • getBranchIdentifier

      public static String getBranchIdentifier(IBAN iban)
      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 null if unknown.