Package nl.garvelink.iban
Class CountryCodes
java.lang.Object
nl.garvelink.iban.CountryCodes
Contains information about IBAN country codes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe longest known valid IBAN.static final intThe shortest known valid IBAN. -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<String> Returns the known country codes.static LocalDateReturns the date that the IBAN reference data was last updated.static StringReturns the version information of the SWIFT IBAN Registry used ongetLastUpdateDate().static intgetLengthForCountryCode(CharSequence countryCode) Returns the IBAN length for a given country code.static booleanisInSwiftRegistry(CharSequence countryCode) Returns whether the source for this IBAN's format and data is the SWIFT IBAN Registry.static booleanisKnownCountryCode(CharSequence aCountryCode) Returns whether the given string is a known country code.static booleanisSEPACountry(CharSequence countryCode) Returns whether the given country code is in SEPA.
-
Field Details
-
SHORTEST_IBAN_LENGTH
public static final int SHORTEST_IBAN_LENGTHThe shortest known valid IBAN. -
LONGEST_IBAN_LENGTH
public static final int LONGEST_IBAN_LENGTHThe longest known valid IBAN.
-
-
Method Details
-
getLengthForCountryCode
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
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
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
Returns the known country codes.- Returns:
- the collection of known country codes, upper case, in alphabetical order.
-
isKnownCountryCode
Returns whether the given string is a known country code.- Parameters:
aCountryCode- the string to evaluate.- Returns:
trueifaCountryCodeis a two-letter, uppercase String present ingetKnownCountryCodes().
-
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
Returns the version information of the SWIFT IBAN Registry used ongetLastUpdateDate().- Returns:
- revision information of the SWIFT IBAN Registry.
- Since:
- 1.7.0
-