Class CountryCodes

java.lang.Object
nl.garvelink.iban.CountryCodes

public abstract class CountryCodes extends Object
Contains information about IBAN country codes.
  • Field Details

    • SHORTEST_IBAN_LENGTH

      public static final int SHORTEST_IBAN_LENGTH
      The shortest known valid IBAN.
    • LONGEST_IBAN_LENGTH

      public static final int LONGEST_IBAN_LENGTH
      The longest known valid IBAN.
  • Method Details

    • getLengthForCountryCode

      public static int getLengthForCountryCode(CharSequence countryCode)
      Returns the IBAN length for a given country code.
      Parameters:
      countryCode - a non-null, uppercase, two-character country code.
      Returns:
      the IBAN length for the given country, or -1 if the input is not a known, two-character country code.
      Throws:
      NullPointerException - if the input is null.
    • isSEPACountry

      public static boolean isSEPACountry(CharSequence countryCode)
      Returns whether the given country code is in SEPA.
      Parameters:
      countryCode - a non-null, uppercase, two-character country code.
      Returns:
      true if SEPA, false if not.
      Throws:
      NullPointerException - if the input is null.
    • isInSwiftRegistry

      public static boolean isInSwiftRegistry(CharSequence countryCode)
      Returns whether the source for this IBAN's format and data is the SWIFT IBAN Registry.
      Parameters:
      countryCode - a non-null, uppercase, two-character country code.
      Returns:
      true if our data is from the SWIFT IBAN Registry, false if not.
      Throws:
      NullPointerException - if the input is null.
    • getKnownCountryCodes

      public static Collection<String> getKnownCountryCodes()
      Returns the known country codes.
      Returns:
      the collection of known country codes, upper case, in alphabetical order.
    • isKnownCountryCode

      public static boolean isKnownCountryCode(CharSequence aCountryCode)
      Returns whether the given string is a known country code.
      Parameters:
      aCountryCode - the string to evaluate.
      Returns:
      true if aCountryCode is a two-letter, uppercase String present in getKnownCountryCodes().
    • getLastUpdateDate

      public static LocalDate getLastUpdateDate()
      Returns the date that the IBAN reference data was last updated.
      Returns:
      last update date of the reference data in this library.
      Since:
      1.7.0
    • getLastUpdateRevision

      public static String getLastUpdateRevision()
      Returns the version information of the SWIFT IBAN Registry used on getLastUpdateDate().
      Returns:
      revision information of the SWIFT IBAN Registry.
      Since:
      1.7.0