public final class Country extends Object implements Comparable<Country>, Serializable
This class represents a country or territory that it is useful to identify. Any two letter code may be used, however it is intended to use codes based on ISO-3166-1 alpha-2.
This class is immutable and thread-safe.
| Modifier and Type | Field and Description |
|---|---|
static Country |
AR
The country 'AR' - Argentina.
|
static Country |
AT
The country 'AT' - Austria.
|
static Country |
AU
The country 'AU' - Australia.
|
static Country |
BE
The country 'BE' - Belgium.
|
static Country |
BR
The country 'BR' - Brazil.
|
static Country |
CA
The country 'CA' - Canada.
|
static Country |
CH
The country 'CH' - Switzerland.
|
static Country |
CL
The country 'CL' - Chile.
|
static Country |
CN
The country 'CN' - China.
|
static Country |
CZ
The currency 'CZ' - Czech Republic.
|
static Country |
DE
The country 'DE' - Germany.
|
static Country |
DK
The country 'DK' - Denmark.
|
static Country |
EG
The currency 'EG' - Egypt.
|
static Country |
ES
The currency 'ES' - Spain.
|
static Country |
EU
The region of 'EU' - Europe (special status in ISO-3166).
|
static Country |
FI
The currency 'FI' - Finland.
|
static Country |
FR
The currency 'FR' - France.
|
static Country |
GB
The country 'GB' - United Kingdom.
|
static Country |
GR
The country 'GR' - Greece.
|
static Country |
HK
The currency 'HK' - Hong Kong.
|
static Country |
HU
The currency 'HU' = Hungary.
|
static Country |
ID
The country 'ID' - Indonesia.
|
static Country |
IE
The currency 'IE' - Ireland.
|
static Country |
IL
The country 'IL' - Israel.
|
static Country |
IN
The country 'IN' - India.
|
static Country |
IS
The currency 'IS' - Iceland.
|
static Country |
IT
The currency 'IT' - Italy.
|
static Country |
JP
The country 'JP' - Japan.
|
static Country |
KR
The country 'KR' - South Korea.
|
static Country |
LU
The currency 'LU' - Luxembourg.
|
static Country |
MX
The country 'MX' - Mexico.
|
static Country |
MY
The country 'MY' - Malaysia.
|
static Country |
NL
The currency 'NL' - Netherlands.
|
static Country |
NO
The currency 'NO' - Norway.
|
static Country |
NZ
The country 'NZ' - New Zealand.
|
static Country |
PL
The currency 'PL' = Poland.
|
static Country |
PT
The currency 'PT' - Portugal.
|
static Country |
RU
The currency 'RU' = Russia.
|
static Country |
SA
The country 'SA' - Saudi Arabia.
|
static Country |
SE
The currency 'SE' - Sweden.
|
static Country |
SG
The country 'SG' - Singapore.
|
static Country |
SK
The currency 'SK' - Slovakia.
|
static Country |
TH
The country 'TH' - Thailand.
|
static Country |
TR
The country 'TR' - Turkey.
|
static Country |
US
The country 'US' - United States.
|
static Country |
ZA
The country 'ZA' - South Africa.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Country other)
Compares this country to another.
|
boolean |
equals(Object obj)
Checks if this country equals another country.
|
static Set<Country> |
getAvailableCountries()
Obtains the set of available countries.
|
String |
getCode()
Gets the two letter ISO code.
|
String |
getCode3Char()
Gets the ISO-3166-1 alpha-3 three letter country code.
|
int |
hashCode()
Returns a suitable hash code for the country.
|
static Country |
of(String countryCode)
Obtains an instance from the specified ISO-3166-1 alpha-2
two letter country code dynamically creating a country if necessary.
|
static Country |
of3Char(String countryCode)
Obtains an instance from the specified ISO-3166-1 alpha-3
three letter country code dynamically creating a country if necessary.
|
static Country |
parse(String countryCode)
Parses a string to obtain a
Country. |
String |
toString()
Returns a string representation of the country, which is the two letter code.
|
public static final Country EU
public static final Country AT
public static final Country BE
public static final Country CH
public static final Country CZ
public static final Country DE
public static final Country DK
public static final Country ES
public static final Country FI
public static final Country FR
public static final Country GB
public static final Country GR
public static final Country HU
public static final Country IE
public static final Country IS
public static final Country IT
public static final Country LU
public static final Country NL
public static final Country NO
public static final Country PL
public static final Country PT
public static final Country SE
public static final Country SK
public static final Country TR
public static final Country AR
public static final Country BR
public static final Country CA
public static final Country CL
public static final Country MX
public static final Country US
public static final Country AU
public static final Country CN
public static final Country EG
public static final Country HK
public static final Country ID
public static final Country IL
public static final Country IN
public static final Country JP
public static final Country KR
public static final Country MY
public static final Country NZ
public static final Country RU
public static final Country SA
public static final Country SG
public static final Country TH
public static final Country ZA
public static Set<Country> getAvailableCountries()
This contains all the countries that have been defined at the point that the method is called.
public static Country of(String countryCode)
A country is uniquely identified by ISO-3166-1 alpha-2 two letter code. This method creates the country if it is not known.
countryCode - the two letter country code, ASCII and upper caseIllegalArgumentException - if the country code is invalidpublic static Country parse(String countryCode)
Country.
The parse is identical to of(String) except that it will convert
letters to upper case first.
countryCode - the two letter country code, ASCIIIllegalArgumentException - if the country code is invalidpublic static Country of3Char(String countryCode)
A country is uniquely identified by ISO-3166-1 alpha-3 three letter code. This method creates the country if it is not known.
countryCode - the three letter country code, ASCII and upper caseIllegalArgumentException - if the country code is invalidpublic String getCode()
public String getCode3Char()
IllegalArgumentException - if the country is invalidpublic int compareTo(Country other)
The comparison sorts alphabetically by the two letter country code.
compareTo in interface Comparable<Country>other - the other countrypublic boolean equals(Object obj)
The comparison checks the two letter country code.
public int hashCode()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.