Enum Class CurrencyCode
- All Implemented Interfaces:
Serializable
,Comparable<CurrencyCode>
,java.lang.constant.Constable
The initial entries in this enum was created based on the official currency & funds code list (ISO 4217) of January 1, 2014.
- Since:
- 1.9
- Author:
- Takahiko Kawasaki
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionUAE Dirham [numeric code = 784, minor unit = 2]Afghani [numeric code = 971, minor unit = 2]Lek [numeric code = 8, minor unit = 2]Armenian Dram [numeric code = 51, minor unit = 2]Netherlands Antillean Guilder [numeric code = 532, minor unit = 2]Kwanza [numeric code = 973, minor unit = 2]Argentine Peso [numeric code = 32, minor unit = 2]Australian Dollar [numeric code = 36, minor unit = 2]Aruban Florin [numeric code = 533, minor unit = 2]Azerbaijanian Manat [numeric code = 944, minor unit = 2]Convertible Mark [numeric code = 977, minor unit = 2]Barbados Dollar [numeric code = 52, minor unit = 2]Taka [numeric code = 50, minor unit = 2]Bulgarian Lev [numeric code = 975, minor unit = 2]Bahraini Dinar [numeric code = 48, minor unit = 3]Burundi Franc [numeric code = 108, minor unit = 0]Bermudian Dollar [numeric code = 60, minor unit = 2]Brunei Dollar [numeric code = 96, minor unit = 2]Boliviano [numeric code = 68, minor unit = 2]Mvdol [numeric code = 984, minor unit = 2, fund]Brazilian Real [numeric code = 986, minor unit = 2]Bahamian Dollar [numeric code = 44, minor unit = 2]Ngultrum [numeric code = 64, minor unit = 2]Pula [numeric code = 72, minor unit = 2]Belarusian Ruble [numeric code = 933, minor unit = 2]Deprecated.Belize Dollar [numeric code = 84, minor unit = 2]Canadian Dollar [numeric code = 124, minor unit = 2]Congolese Franc [numeric code = 976, minor unit = 2]WIR Euro [numeric code = 947, minor unit = 2, fund]Swiss Franc [numeric code = 756, minor unit = 2]WIR Franc [numeric code = 948, minor unit = 2, fund]Unidad de Fomento [numeric code = 990, minor unit = 0, fund]Chilean Peso [numeric code = 152, minor unit = 0]Yuan Renminbi [numeric code = 156, minor unit = 2]Colombian Peso [numeric code = 170, minor unit = 2]Unidad de Valor Real [numeric code = 970, minor unit = 2, fund]Costa Rican Colon [numeric code = 188, minor unit = 2]Peso Convertible [numeric code = 931, minor unit = 2]Cuban Peso [numeric code = 192, minor unit = 2]Cape Verde Escudo [numeric code = 132, minor unit = 2]Czech Koruna [numeric code = 203, minor unit = 2]Djibouti Franc [numeric code = 262, minor unit = 0]Danish Krone [numeric code = 208, minor unit = 2]Dominican Peso [numeric code = 214, minor unit = 2]Algerian Dinar [numeric code = 12, minor unit = 2]Egyptian Pound [numeric code = 818, minor unit = 2]Nakfa [numeric code = 232, minor unit = 2]Ethiopian Birr [numeric code = 230, minor unit = 2]Euro [numeric code = 978, minor unit = 2]Fiji Dollar [numeric code = 242, minor unit = 2]Falkland Islands Pound [numeric code = 238, minor unit = 2]Pound Sterling [numeric code = 826, minor unit = 2]Lari [numeric code = 981, minor unit = 2]Ghana Cedi [numeric code = 936, minor unit = 2]Gibraltar Pound [numeric code = 292, minor unit = 2]Dalasi [numeric code = 270, minor unit = 2]Guinea Franc [numeric code = 324, minor unit = 0]Quetzal [numeric code = 320, minor unit = 2]Guyana Dollar [numeric code = 328, minor unit = 2]Hong Kong Dollar [numeric code = 344, minor unit = 2]Lempira [numeric code = 340, minor unit = 2]Croatian Kuna [numeric code = 191, minor unit = 2]Gourde [numeric code = 332, minor unit = 2]Forint [numeric code = 348, minor unit = 2]Rupiah [numeric code = 360, minor unit = 2]New Israeli Sheqel [numeric code = 376, minor unit = 2]Indian Rupee [numeric code = 356, minor unit = 2]Iraqi Dinar [numeric code = 368, minor unit = 3]Iranian Rial [numeric code = 364, minor unit = 2]Iceland Krona [numeric code = 352, minor unit = 0]Jamaican Dollar [numeric code = 388, minor unit = 2]Jordanian Dinar [numeric code = 400, minor unit = 3]Yen [numeric code = 392, minor unit = 0]Kenyan Shilling [numeric code = 404, minor unit = 2]Som [numeric code = 417, minor unit = 2]Riel [numeric code = 116, minor unit = 2]Comoro Franc [numeric code = 174, minor unit = 0]North Korean Won [numeric code = 408, minor unit = 2]Won [numeric code = 410, minor unit = 0]Kuwaiti Dinar [numeric code = 414, minor unit = 3]Cayman Islands Dollar [numeric code = 136, minor unit = 2]Tenge [numeric code = 398, minor unit = 2]Kip [numeric code = 418, minor unit = 2]Lebanese Pound [numeric code = 422, minor unit = 2]Sri Lanka Rupee [numeric code = 144, minor unit = 2]Liberian Dollar [numeric code = 430, minor unit = 2]Loti [numeric code = 426, minor unit = 2]Deprecated.Libyan Dinar [numeric code = 434, minor unit = 3]Moroccan Dirham [numeric code = 504, minor unit = 2]Moldovan Leu [numeric code = 498, minor unit = 2]Malagasy Ariary [numeric code = 969, minor unit = 2]Denar [numeric code = 807, minor unit = 2]Kyat [numeric code = 104, minor unit = 2]Tugrik [numeric code = 496, minor unit = 2]Pataca [numeric code = 446, minor unit = 2]Deprecated.Ouguiya [numeric code = 929, minor unit = 2]Mauritius Rupee [numeric code = 480, minor unit = 2]Rufiyaa [numeric code = 462, minor unit = 2]Kwacha [numeric code = 454, minor unit = 2]Mexican Peso [numeric code = 484, minor unit = 2]Mexican Unidad de Inversion (UDI) [numeric code = 979, minor unit = 2, fund]Malaysian Ringgit [numeric code = 458, minor unit = 2]Mozambique Metical [numeric code = 943, minor unit = 2]Namibia Dollar [numeric code = 516, minor unit = 2]Naira [numeric code = 566, minor unit = 2]Cordoba Oro [numeric code = 558, minor unit = 2]Norwegian Krone [numeric code = 578, minor unit = 2]Nepalese Rupee [numeric code = 524, minor unit = 2]New Zealand Dollar [numeric code = 554, minor unit = 2]Rial Omani [numeric code = 512, minor unit = 3]Balboa [numeric code = 590, minor unit = 2]Nuevo Sol [numeric code = 604, minor unit = 2]Kina [numeric code = 598, minor unit = 2]Philippine Peso [numeric code = 608, minor unit = 2]Pakistan Rupee [numeric code = 586, minor unit = 2]Zloty [numeric code = 985, minor unit = 2]Guarani [numeric code = 600, minor unit = 0]Qatari Rial [numeric code = 634, minor unit = 2]New Romanian Leu [numeric code = 946, minor unit = 2]Serbian Dinar [numeric code = 941, minor unit = 2]Russian Ruble [numeric code = 643, minor unit = 2]Deprecated.Rwanda Franc [numeric code = 646, minor unit = 0]Saudi Riyal [numeric code = 682, minor unit = 2]Solomon Islands Dollar [numeric code = 90, minor unit = 2]Seychelles Rupee [numeric code = 690, minor unit = 2]Sudanese Pound [numeric code = 938, minor unit = 2]Swedish Krona [numeric code = 752, minor unit = 2]Singapore Dollar [numeric code = 702, minor unit = 2]Saint Helena Pound [numeric code = 654, minor unit = 2]Leone [numeric code = 694, minor unit = 2]Somali Shilling [numeric code = 706, minor unit = 2]Surinam Dollar [numeric code = 968, minor unit = 2]South Sudanese Pound [numeric code = 728, minor unit = 2]Deprecated.Dobra [numeric code = 930, minor unit = 2]El Salvador Colon [numeric code = 222, minor unit = 2]Syrian Pound [numeric code = 760, minor unit = 2]Lilangeni [numeric code = 748, minor unit = 2]Baht [numeric code = 764, minor unit = 2]Somoni [numeric code = 972, minor unit = 2]Turkmenistan New Manat [numeric code = 934, minor unit = 2]Tunisian Dinar [numeric code = 788, minor unit = 3]Paʻanga [numeric code = 776, minor unit = 2]Turkish Lira [numeric code = 949, minor unit = 2]Trinidad and Tobago Dollar [numeric code = 780, minor unit = 2]New Taiwan Dollar [numeric code = 901, minor unit = 2]Tanzanian Shilling [numeric code = 834, minor unit = 2]Hryvnia [numeric code = 980, minor unit = 2]Uganda Shilling [numeric code = 800, minor unit = 0]Undefined.US Dollar [numeric code = 840, minor unit = 2]US Dollar (Next day) [numeric code = 997, minor unit = 2, fund]US Dollar (Same day) [numeric code = 998, minor unit = 2, fund]Uruguay Peso en Unidades Indexadas (URUIURUI) [numeric code = 940, minor unit = 0, fund]Peso Uruguayo [numeric code = 858, minor unit = 2]Uzbekistan Sum [numeric code = 860, minor unit = 2]Deprecated.Bolivar [numeric code = 928, minor unit = 2]Dong [numeric code = 704, minor unit = 0]Vatu [numeric code = 548, minor unit = 0]Tala [numeric code = 882, minor unit = 2]CFA Franc BEAC [numeric code = 950, minor unit = 0]Silver [numeric code = 961, minor unit = -1, precious metal]Gold [numeric code = 959, minor unit = -1, precious metal]Bond Markets Unit European Composite Unit (EURCO) [numeric code = 955, minor unit = -1]Bond Markets Unit European Monetary Unit (E.M.U.-6) [numeric code = 956, minor unit = -1]Bond Markets Unit European Unit of Account 9 (E.U.A.-9) [numeric code = 957, minor unit = -1]Bond Markets Unit European Unit of Account 17 (E.U.A.-17) [numeric code = 958, minor unit = -1]East Caribbean Dollar [numeric code = 951, minor unit = 2]SDR (Special Drawing Right) [numeric code = 960, minor unit = -1]CFA Franc BCEAO [numeric code = 952, minor unit = 0]Palladium [numeric code = 964, minor unit = -1, precious metal]CFP Franc [numeric code = 953, minor unit = 0]Platinum [numeric code = 962, minor unit = -1, precious metal]Sucre [numeric code = 994, minor unit = -1]Codes specifically reserved for testing purposes.ADB Unit of Account [numeric code = 965, minor unit = -1]The codes assigned for transactions where no currency is involved [numeric code = 999, minor unit = -1]Yemeni Rial [numeric code = 886, minor unit = 2]Rand [numeric code = 710, minor unit = 2]Zambian Kwacha [numeric code = 967, minor unit = 2]Zimbabwe Dollar [numeric code = 932, minor unit = 2] -
Method Summary
Modifier and TypeMethodDescriptionstatic List<CurrencyCode>
findByName
(String regex) Get a list ofCurrencyCode
by a name regular expression.static List<CurrencyCode>
findByName
(Pattern pattern) Get a list ofCurrencyCode
by a name pattern.static CurrencyCode
getByCode
(int code) Get aCurrencyCode
that corresponds to the given ISO 4217 numeric code.static CurrencyCode
Get aCurrencyCode
that corresponds to the given ISO 4217 alpha-3 code.static CurrencyCode
Get aCurrencyCode
that corresponds to the given ISO 4217 alpha-3 code.static CurrencyCode
getByCodeIgnoreCase
(String code) Get aCurrencyCode
that corresponds to the given ISO 4217 alpha-3 code.static List<CurrencyCode>
getByCountry
(CountryCode country) Get a list ofCurrencyCode
instances whose country list contains the specified country.static List<CurrencyCode>
getByCountry
(String country) Get a list ofCurrencyCode
instances whose country list contains the specified country.static List<CurrencyCode>
getByCountry
(String country, boolean caseSensitive) Get a list ofCurrencyCode
instances whose country list contains the specified country.static List<CurrencyCode>
getByCountryIgnoreCase
(String country) Get a list ofCurrencyCode
instances whose country list contains the specified country.Get the list of countries using this currency.Get theCurrency
instance that corresponds to this currency code.int
Get the minor unit.getName()
Get the currency name.int
Get the ISO 4217 numeric code.boolean
isFund()
Check if this currency code represents a fund.boolean
Check if this currency code represents a precious metal.static CurrencyCode
Returns the enum constant of this class with the specified name.static CurrencyCode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNDEFINED
Undefined.This is not an official ISO 4217 code.
- Since:
- 1.14
- See Also:
-
AED
-
AFN
-
ALL
-
AMD
-
ANG
Netherlands Antillean Guilder [numeric code = 532, minor unit = 2]Used by:
-
AOA
-
ARS
-
AUD
-
AWG
-
AZN
-
BAM
-
BBD
-
BDT
-
BGN
-
BHD
-
BIF
-
BMD
-
BND
-
BOB
-
BOV
Mvdol [numeric code = 984, minor unit = 2, fund]Used by:
BO
: BOLIVIA, PLURINATIONAL STATE OF
-
BRL
-
BSD
-
BTN
-
BWP
-
BYN
Belarusian Ruble [numeric code = 933, minor unit = 2]Used by:
BY
: BELARUS
This currency code was added by ISO 4217 AMENDMENT NUMBER 161 (18 December 2015). Effective from 1 July 2016.
- Since:
- 1.19
- See Also:
-
BYR
Deprecated.- See Also:
-
BZD
-
CAD
-
CDF
-
CHE
WIR Euro [numeric code = 947, minor unit = 2, fund]Used by:
CH
: SWITZERLAND
-
CHF
-
CHW
WIR Franc [numeric code = 948, minor unit = 2, fund]Used by:
CH
: SWITZERLAND
-
CLF
-
CLP
-
CNY
-
COP
-
COU
-
CRC
-
CUC
-
CUP
-
CVE
-
CZK
-
DJF
-
DKK
Danish Krone [numeric code = 208, minor unit = 2]Used by:
-
DOP
-
DZD
-
EGP
-
ERN
-
ETB
-
EUR
Euro [numeric code = 978, minor unit = 2]Used by:
AD
: ANDORRAAT
: AUSTRIAAX
: ÅLAND ISLANDSBE
: BELGIUMBL
: SAINT BARTHÉLEMYCY
: CYPRUSDE
: GERMANYEE
: ESTONIAES
: SPAINEU
: EUROPEAN UNIONFI
: FINLANDFR
: FRANCEGF
: FRENCH GUIANAGP
: GUADELOUPEGR
: GREECEIE
: IRELANDIT
: ITALYLT
: LITHUANIALU
: LUXEMBOURGLV
: LATVIAMC
: MONACOME
: MONTENEGROMF
: SAINT MARTIN (FRENCH PART)MQ
: MARTINIQUEMT
: MALTANL
: NETHERLANDSPM
: SAINT PIERRE AND MIQUELONPT
: PORTUGALRE
: RÉUNIONSI
: SLOVENIASK
: SLOVAKIASM
: SAN MARINOTF
: FRENCH SOUTHERN TERRITORIESVA
: HOLY SEE (VATICAN CITY STATE)XK
: KOSOVO, REPUBLIC OFYT
: MAYOTTE
-
FJD
-
FKP
Falkland Islands Pound [numeric code = 238, minor unit = 2]Used by:
FK
: FALKLAND ISLANDS (MALVINAS)
-
GBP
Pound Sterling [numeric code = 826, minor unit = 2]Used by:
-
GEL
-
GHS
-
GIP
-
GMD
-
GNF
-
GTQ
-
GYD
-
HKD
-
HNL
-
HRK
-
HTG
-
HUF
-
IDR
-
ILS
-
INR
-
IQD
-
IRR
-
ISK
-
JMD
-
JOD
-
JPY
-
KES
-
KGS
-
KHR
-
KMF
-
KPW
North Korean Won [numeric code = 408, minor unit = 2]Used by:
KP
: KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF
-
KRW
-
KWD
-
KYD
-
KZT
-
LAK
-
LBP
-
LKR
-
LRD
-
LSL
-
LTL
Deprecated. -
LYD
-
MAD
-
MDL
-
MGA
-
MKD
-
MMK
-
MNT
-
MOP
-
MRO
Deprecated.- See Also:
-
MRU
Ouguiya [numeric code = 929, minor unit = 2]Used by:
MR
: MAURITANIA
Excerpted from ISO 4217 AMENDMENT NUMBER 165:
The Central Bank of Mauritania is carrying out a re-denomination of their local currency, with the entry into circulation of the OUGUIYA. The conversion rate is 10 (old) Ouguiya to 1 (new) Ouguiya (10:1).
From 1 January 2018 to 30 June 2018, the old and new denominations run concurrently.
- Since:
- 1.23
- See Also:
-
MUR
-
MVR
-
MWK
-
MXN
-
MXV
-
MYR
-
MZN
-
NAD
-
NGN
-
NIO
-
NOK
Norwegian Krone [numeric code = 578, minor unit = 2]Used by:
-
NPR
-
NZD
-
OMR
-
PAB
-
PEN
-
PGK
-
PHP
-
PKR
-
PLN
-
PYG
-
QAR
-
RON
-
RSD
-
RUB
- See Also:
-
RUR
Deprecated.Russian Ruble before the 1998 redenomination (1RUB
= 1,000RUR
). [numeric code = 810, minor unit = 2]Used by:
RU
: RUSSIAN FEDERATION
- Since:
- 1.20
- See Also:
-
RWF
-
SAR
-
SBD
-
SCR
-
SDG
-
SEK
-
SGD
-
SHP
Saint Helena Pound [numeric code = 654, minor unit = 2]Used by:
SH
: SAINT HELENA, ASCENSION AND TRISTAN DA CUNHA
-
SLL
-
SOS
-
SRD
-
SSP
-
STD
Deprecated.- See Also:
-
STN
Dobra [numeric code = 930, minor unit = 2]Used by:
ST
: SAO TOME AND PRINCIPE
Excerpted from ISO 4217 AMENDMENT NUMBER 164:
The Central Bank of S. Tomé and Príncipe is carrying out an important Monetary Reform Project, with the entry into circulation of a new family of DOBRAS. The conversion rate is 1000 (old) Dobras to 1 (new) Dobra (1000:1).
From 1 January 2018 to 30 June 2018, the old and new denominations run concurrently.
- Since:
- 1.23
- See Also:
-
SVC
-
SYP
-
SZL
-
THB
-
TJS
-
TMT
-
TND
-
TOP
-
TRY
-
TTD
-
TWD
-
TZS
-
UAH
-
UGX
-
USD
US Dollar [numeric code = 840, minor unit = 2]Used by:
AS
: AMERICAN SAMOABQ
: BONAIRE, SINT EUSTATIUS AND SABAEC
: ECUADORFM
: MICRONESIA, FEDERATED STATES OFGU
: GUAMHT
: HAITIIO
: BRITISH INDIAN OCEAN TERRITORYMH
: MARSHALL ISLANDSMP
: NORTHERN MARIANA ISLANDSPA
: PANAMAPR
: PUERTO RICOPW
: PALAUSV
: EL SALVADORTC
: TURKS AND CAICOS ISLANDSTL
: TIMOR-LESTEUM
: UNITED STATES MINOR OUTLYING ISLANDSUS
: UNITED STATESVG
: VIRGIN ISLANDS (BRITISH)VI
: VIRGIN ISLANDS (US)
-
USN
US Dollar (Next day) [numeric code = 997, minor unit = 2, fund]Used by:
US
: UNITED STATES
-
USS
US Dollar (Same day) [numeric code = 998, minor unit = 2, fund]Used by:
US
: UNITED STATES
-
UYI
Uruguay Peso en Unidades Indexadas (URUIURUI) [numeric code = 940, minor unit = 0, fund]Used by:
UY
: URUGUAY
-
UYU
-
UZS
-
VEF
Deprecated.- See Also:
-
VES
- See Also:
-
VND
-
VUV
-
WST
-
XAF
-
XAG
Silver [numeric code = 961, minor unit = -1, precious metal] -
XAU
Gold [numeric code = 959, minor unit = -1, precious metal] -
XBA
Bond Markets Unit European Composite Unit (EURCO) [numeric code = 955, minor unit = -1] -
XBB
Bond Markets Unit European Monetary Unit (E.M.U.-6) [numeric code = 956, minor unit = -1] -
XBC
Bond Markets Unit European Unit of Account 9 (E.U.A.-9) [numeric code = 957, minor unit = -1] -
XBD
Bond Markets Unit European Unit of Account 17 (E.U.A.-17) [numeric code = 958, minor unit = -1] -
XCD
-
XDR
SDR (Special Drawing Right) [numeric code = 960, minor unit = -1] -
XOF
-
XPD
Palladium [numeric code = 964, minor unit = -1, precious metal] -
XPF
-
XPT
Platinum [numeric code = 962, minor unit = -1, precious metal] -
XSU
Sucre [numeric code = 994, minor unit = -1] -
XTS
Codes specifically reserved for testing purposes. [numeric code = 963, minor unit = -1] -
XUA
ADB Unit of Account [numeric code = 965, minor unit = -1] -
XXX
The codes assigned for transactions where no currency is involved [numeric code = 999, minor unit = -1] -
YER
-
ZAR
-
ZMW
-
ZWL
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getByCode
Get aCurrencyCode
that corresponds to the given ISO 4217 alpha-3 code.This method calls
getByCode
(code, true)
. Note that the behavior has changed since the version 1.13. In the older versions, this method was an alias ofgetByCode(code, false)
.- Parameters:
code
- ISO 4217 alpha-3 code. When"UNDEFINED"
is given,CurrencyCode.UNDEFINED
is returned.- Returns:
- A
CurrencyCode
instance, ornull
if not found. - See Also:
-
getByCodeIgnoreCase
Get aCurrencyCode
that corresponds to the given ISO 4217 alpha-3 code.This method calls
getByCode
(code, false)
.- Parameters:
code
- ISO 4217 alpha-3 code. Or"UNDEFINED"
(case insensitive).- Returns:
- A
CurrencyCode
instance, ornull
if not found. - Since:
- 1.13
- See Also:
-
getByCode
Get aCurrencyCode
that corresponds to the given ISO 4217 alpha-3 code.- Parameters:
code
- ISO 4217 alpha-3 code. Or"UNDEFINED"
(its case sensitivity depends on the value ofcaseSensitive
).caseSensitive
- Iftrue
, the given code should consist of upper-case letters only. Iffalse
, this method internally canonicalizes the given code byString.toUpperCase()
and then performs search. For example,getByCode("jpy", true)
returnsnull
, but on the other hand,getByCode("jpy", false)
returnsCurrencyCode.JPY
.- Returns:
- A
CurrencyCode
instance, ornull
if not found.
-
getByCode
Get aCurrencyCode
that corresponds to the given ISO 4217 numeric code.- Parameters:
code
- ISO 4217 numeric code.- Returns:
- A
CurrencyCode
instance, ornull
if not found. If 0 or a negative value is given,null
is returned.
-
getByCountry
Get a list ofCurrencyCode
instances whose country list contains the specified country.This method is an alias of
getByCountry
(country, true)
. Note that the behavior has changed since the version 1.13. In the older versions, this method was an alias ofgetByCountry(code, false)
.- Parameters:
country
- Country code. ISO 3166-1 alpha-2 or alpha-3.- Returns:
- List of
CurrencyCode
instances. If there is noCurrencyCode
instance whose country list contains the specified country, the size of the returned list is zero.
-
getByCountryIgnoreCase
Get a list ofCurrencyCode
instances whose country list contains the specified country.This method is an alias of
getByCountry
(country, false)
.- Parameters:
country
- Country code. ISO 3166-1 alpha-2 or alpha-3.- Returns:
- List of
CurrencyCode
instances. If there is noCurrencyCode
instance whose country list contains the specified country, the size of the returned list is zero. - Since:
- 1.13
-
getByCountry
Get a list ofCurrencyCode
instances whose country list contains the specified country.This method is an alias of
getByCountry
(
CountryCode
.
getByCode
(country, caseSensitive))
.- Parameters:
country
- Country code. ISO 3166-1 alpha-2 or alpha-3.caseSensitive
- Iftrue
, the given code should consist of uppercase letters only. Iffalse
, case is ignored.- Returns:
- List of
CurrencyCode
instances. If there is noCurrencyCode
instance whose country list contains the specified country, the size of the returned list is zero.
-
getByCountry
Get a list ofCurrencyCode
instances whose country list contains the specified country.- Parameters:
country
-CountryCode
instance that represents a country.- Returns:
- List of
CurrencyCode
instances. If there is noCurrencyCode
instance whose country list contains the specified country, the size of the returned list is zero.
-
findByName
Get a list ofCurrencyCode
by a name regular expression.This method is almost equivalent to
findByName
(Pattern.compile(regex))
.- Parameters:
regex
- Regular expression for names.- Returns:
- List of
CurrencyCode
. If nothing has matched, an empty list is returned. - Throws:
IllegalArgumentException
-regex
isnull
.PatternSyntaxException
-regex
failed to be compiled.- Since:
- 1.11
-
findByName
Get a list ofCurrencyCode
by a name pattern.For example, the list obtained by the code snippet below:
Pattern pattern = Pattern.compile(".*Ruble"); List<CurrencyCode> list = CurrencyCode.findByName(pattern);
contains 4
CurrencyCode
s as listed below.- Parameters:
pattern
- Pattern to match names.- Returns:
- List of
CurrencyCde
. If nothing has matched, an empty list is returned. - Throws:
IllegalArgumentException
-pattern
isnull
.- Since:
- 1.11
-
getName
Get the currency name.- Returns:
- The currency name.
-
getNumeric
public int getNumeric()Get the ISO 4217 numeric code.- Returns:
- The ISO 4217 numeric code.
-
getMinorUnit
public int getMinorUnit()Get the minor unit.- Returns:
- The minor unit.
-1
means N.A.
-
getCountryList
Get the list of countries using this currency.- Returns:
- The list of countries using this currency.
-
isFund
public boolean isFund()Check if this currency code represents a fund.CurrencyCode
instances listed below returntrue
.- Returns:
- True if this currency code represents a fund.
-
isPreciousMetal
public boolean isPreciousMetal()Check if this currency code represents a precious metal.CurrencyCode
instances listed below returntrue
.- Returns:
- True if this currency code represents a precious metal.
-
getCurrency
Get theCurrency
instance that corresponds to this currency code.This method is an alias of
Currency
.
getInstance
(this.name())
. The only difference is that this method returnsnull
whenCurrency.getInstance(String)
throwsIllegalArgumentException
.- Returns:
- A
Currency
instance, ornull
if this ISO 4217 code is not supported by the implementation ofCurrency.getInstance(String)
. - See Also:
-