@Deprecated public enum LDCountryCode extends java.lang.Enum<LDCountryCode>
Enum names of this enum themselves are represented by
ISO 3166-1 alpha-2
code (2-letter upper-case alphabets). There are instance methods to get the
country name (getName()
), the
ISO 3166-1 alpha-3
code (getAlpha3()
) and the
ISO 3166-1 numeric
code (getNumeric()
).
In addition, there are static methods to get a CountryCode
instance that
corresponds to a given alpha-2/alpha-3/numeric code (getByCode(String)
,
getByCode(int)
).
// List all the country codes. for (CountryCode code : CountryCode.values()) { // For example, "[US] United States" is printed. System.out.format("[%s] %s\n", code, code.getName()
); } // Get a CountryCode instance by ISO 3166-1 code. CountryCode code = CountryCode.getByCode
("JP"); // Print all the information. Output will be: // // Country name = Japan // ISO 3166-1 alpha-2 code = JP // ISO 3166-1 alpha-3 code = JPN // ISO 3166-1 numeric code = 392 // Assignment state = OFFICIALLY_ASSIGNED // System.out.println("Country name = " + code.getName()
); System.out.println("ISO 3166-1 alpha-2 code = " + code.getAlpha2()
); System.out.println("ISO 3166-1 alpha-3 code = " + code.getAlpha3()
); System.out.println("ISO 3166-1 numeric code = " + code.getNumeric()
); System.out.println("Assignment state = " + code.getAssignment()
); // Convert to a Locale instance.Locale
locale = code.toLocale()
; // Get a CountryCode by a Locale instance. code = CountryCode.getByLocale
(locale); // Get the currency of the country.Currency
currency = code.getCurrency()
; // Get a list by a regular expression for names. // // The list will contain: // // CountryCode.AE : United Arab Emirates // CountryCode.GB : United Kingdom // CountryCode.TZ : Tanzania, United Republic of // CountryCode.UK : United Kingdom // CountryCode.UM : United States Minor Outlying Islands // CountryCode.US : United States // List<CountryCode> list = CountryCode.findByName
(".*United.*");
Enum Constant and Description |
---|
AC
Deprecated.
Ascension Island
[AC, ASC, -1,
Exceptionally reserved]
|
AD
Deprecated.
|
AE
Deprecated.
United Arab Emirates
[AE, AE, 784,
Officially assigned]
|
AF
Deprecated.
Afghanistan
[AF, AFG, 4,
Officially assigned]
|
AG
Deprecated.
Antigua and Barbuda
[AG, ATG, 28,
Officially assigned]
|
AI
Deprecated.
|
AL
Deprecated.
|
AM
Deprecated.
|
AN
Deprecated.
Netherlands Antilles
[AN, ANHH, 530,
Traditionally reserved]
|
AO
Deprecated.
|
AQ
Deprecated.
Antarctica
[AQ, ATA, 10,
Officially assigned]
|
AR
Deprecated.
|
AS
Deprecated.
American Samoa
[AS, ASM, 16,
Officially assigned]
|
AT
Deprecated.
|
AU
Deprecated.
|
AW
Deprecated.
|
AX
Deprecated.
Åland Islands
[AX, ALA, 248,
Officially assigned]
|
AZ
Deprecated.
Azerbaijan
[AZ, AZE, 31,
Officially assigned]
|
BA
Deprecated.
Bosnia and Herzegovina
[BA, BIH, 70,
Officially assigned]
|
BB
Deprecated.
|
BD
Deprecated.
Bangladesh
[BD, BGD, 50,
Officially assigned]
|
BE
Deprecated.
|
BF
Deprecated.
Burkina Faso
[BF, BFA, 854,
Officially assigned]
|
BG
Deprecated.
|
BH
Deprecated.
|
BI
Deprecated.
|
BJ
Deprecated.
|
BL
Deprecated.
Saint Barthélemy
[BL, BLM, 652,
Officially assigned]
|
BM
Deprecated.
|
BN
Deprecated.
Brunei Darussalam
[BN, BRN, 96,
Officially assigned]
|
BO
Deprecated.
Bolivia, Plurinational State of
[BO, BOL, 68,
Officially assigned]
|
BQ
Deprecated.
Bonaire, Sint Eustatius and Saba
[BQ, BES, 535,
Officially assigned]
|
BR
Deprecated.
|
BS
Deprecated.
|
BT
Deprecated.
|
BU
Deprecated.
|
BV
Deprecated.
Bouvet Island
[BV, BVT, 74,
Officially assigned]
|
BW
Deprecated.
|
BY
Deprecated.
|
BZ
Deprecated.
|
CA
Deprecated.
|
CC
Deprecated.
Cocos (Keeling) Islands
[CC, CCK, 166,
Officially assigned]
|
CD
Deprecated.
Congo, the Democratic Republic of the
[CD, COD, 180,
Officially assigned]
|
CF
Deprecated.
Central African Republic
[CF, CAF, 140,
Officially assigned]
|
CG
Deprecated.
|
CH
Deprecated.
Switzerland
[CH, CHE, 756,
Officially assigned]
|
CI
Deprecated.
Côte d'Ivoire
[CI, CIV, 384,
Officially assigned]
|
CK
Deprecated.
Cook Islands
[CK, COK, 184,
Officially assigned]
|
CL
Deprecated.
|
CM
Deprecated.
|
CN
Deprecated.
|
CO
Deprecated.
|
CP
Deprecated.
Clipperton Island
[CP, CPT, -1,
Exceptionally reserved]
|
CR
Deprecated.
Costa Rica
[CR, CRI, 188,
Officially assigned]
|
CS
Deprecated.
Serbia and Montenegro
[CS, CSXX, 891,
Traditionally reserved]
|
CU
Deprecated.
|
CV
Deprecated.
Cape Verde
[CV, CPV, 132,
Officially assigned]
|
CW
Deprecated.
|
CX
Deprecated.
Christmas Island
[CX, CXR, 162,
Officially assigned]
|
CY
Deprecated.
|
CZ
Deprecated.
Czech Republic
[CZ, CZE, 203,
Officially assigned]
|
DE
Deprecated.
|
DG
Deprecated.
Diego Garcia
[DG, DGA, -1,
Exceptionally reserved]
|
DJ
Deprecated.
|
DK
Deprecated.
|
DM
Deprecated.
|
DO
Deprecated.
Dominican Republic
[DO, DOM, 214,
Officially assigned]
|
DZ
Deprecated.
|
EA
Deprecated.
|
EC
Deprecated.
|
EE
Deprecated.
|
EG
Deprecated.
|
EH
Deprecated.
Western Sahara
[EH, ESH, 732,
Officially assigned]
|
ER
Deprecated.
|
ES
Deprecated.
|
ET
Deprecated.
|
EU
Deprecated.
European Union
[EU, null, -1,
Exceptionally reserved]
|
FI
Deprecated.
|
FJ
Deprecated.
|
FK
Deprecated.
Falkland Islands (Malvinas)
[FK, FLK, 238,
Officially assigned]
|
FM
Deprecated.
Micronesia, Federated States of
[FM, FSM, 583,
Officially assigned]
|
FO
Deprecated.
Faroe Islands
[FO, FRO, 234,
Officially assigned]
|
FR
Deprecated.
|
FX
Deprecated.
France, Metropolitan
[FX, FXX, -1,
Exceptionally reserved]
|
GA
Deprecated.
|
GB
Deprecated.
United Kingdom
[GB, GBR, 826,
Officially assigned]
|
GD
Deprecated.
|
GE
Deprecated.
|
GF
Deprecated.
French Guiana
[GF, GUF, 254,
Officially assigned]
|
GG
Deprecated.
|
GH
Deprecated.
|
GI
Deprecated.
|
GL
Deprecated.
|
GM
Deprecated.
|
GN
Deprecated.
|
GP
Deprecated.
Guadeloupe
[GP, GLP, 312,
Officially assigned]
|
GQ
Deprecated.
Equatorial Guinea
[GQ, GNQ, 226,
Officially assigned]
|
GR
Deprecated.
|
GS
Deprecated.
South Georgia and the South Sandwich Islands
[GS, SGS, 239,
Officially assigned]
|
GT
Deprecated.
|
GU
Deprecated.
|
GW
Deprecated.
Guinea-Bissau
[GW, GNB, 624,
Officially assigned]
|
GY
Deprecated.
|
HK
Deprecated.
|
HM
Deprecated.
Heard Island and McDonald Islands
[HM, HMD, 334,
Officially assigned]
|
HN
Deprecated.
|
HR
Deprecated.
|
HT
Deprecated.
|
HU
Deprecated.
|
IC
Deprecated.
Canary Islands
[IC, null, -1,
Exceptionally reserved]
|
ID
Deprecated.
|
IE
Deprecated.
|
IL
Deprecated.
|
IM
Deprecated.
Isle of Man
[IM, IMN, 833,
Officially assigned]
|
IN
Deprecated.
|
IO
Deprecated.
British Indian Ocean Territory
[IO, IOT, 86,
Officially assigned]
|
IQ
Deprecated.
|
IR
Deprecated.
Iran, Islamic Republic of
[IR, IRN, 364,
Officially assigned]
|
IS
Deprecated.
|
IT
Deprecated.
|
JE
Deprecated.
|
JM
Deprecated.
|
JO
Deprecated.
|
JP
Deprecated.
|
KE
Deprecated.
|
KG
Deprecated.
Kyrgyzstan
[KG, KGZ, 417,
Officially assigned]
|
KH
Deprecated.
|
KI
Deprecated.
|
KM
Deprecated.
|
KN
Deprecated.
Saint Kitts and Nevis
[KN, KNA, 659,
Officially assigned]
|
KP
Deprecated.
Korea, Democratic People's Republic of
[KP, PRK, 408,
Officially assigned]
|
KR
Deprecated.
Korea, Republic of
[KR, KOR, 410,
Officially assigned]
|
KW
Deprecated.
|
KY
Deprecated.
Cayman Islands
[KY, CYM, 136,
Officially assigned]
|
KZ
Deprecated.
Kazakhstan
[KZ, KAZ, 398,
Officially assigned]
|
LA
Deprecated.
Lao People's Democratic Republic
[LA, LAO, 418,
Officially assigned]
|
LB
Deprecated.
|
LC
Deprecated.
Saint Lucia
[LC, LCA, 662,
Officially assigned]
|
LI
Deprecated.
Liechtenstein
[LI, LIE, 438,
Officially assigned]
|
LK
Deprecated.
|
LR
Deprecated.
|
LS
Deprecated.
|
LT
Deprecated.
|
LU
Deprecated.
Luxembourg
[LU, LUX, 442,
Officially assigned]
|
LV
Deprecated.
|
LY
Deprecated.
|
MA
Deprecated.
|
MC
Deprecated.
|
MD
Deprecated.
Moldova, Republic of
[MD, MDA, 498,
Officially assigned]
|
ME
Deprecated.
Montenegro
[ME, MNE, 499,
Officially assigned]
|
MF
Deprecated.
Saint Martin (French part)
[MF, MAF, 663,
Officially assigned]
|
MG
Deprecated.
Madagascar
[MG, MDG, 450,
Officially assigned]
|
MH
Deprecated.
Marshall Islands
[MH, MHL, 584,
Officially assigned]
|
MK
Deprecated.
Macedonia, the former Yugoslav Republic of
[MK, MKD, 807,
Officially assigned]
|
ML
Deprecated.
|
MM
Deprecated.
|
MN
Deprecated.
|
MO
Deprecated.
|
MP
Deprecated.
Northern Mariana Islands
[MP, MNP, 580,
Officially assigned]
|
MQ
Deprecated.
Martinique
[MQ, MTQ, 474,
Officially assigned]
|
MR
Deprecated.
Mauritania
[MR, MRT, 478,
Officially assigned]
|
MS
Deprecated.
Montserrat
[MS, MSR, 500,
Officially assigned]
|
MT
Deprecated.
|
MU
Deprecated.
|
MV
Deprecated.
|
MW
Deprecated.
|
MX
Deprecated.
|
MY
Deprecated.
|
MZ
Deprecated.
Mozambique
[MZ, MOZ, 508,
Officially assigned]
|
NA
Deprecated.
|
NC
Deprecated.
New Caledonia
[NC, NCL, 540,
Officially assigned]
|
NE
Deprecated.
|
NF
Deprecated.
Norfolk Island
[NF, NFK, 574,
Officially assigned]
|
NG
Deprecated.
|
NI
Deprecated.
|
NL
Deprecated.
Netherlands
[NL, NLD, 528,
Officially assigned]
|
NO
Deprecated.
|
NP
Deprecated.
|
NR
Deprecated.
|
NT
Deprecated.
Neutral Zone
[NT, NTHH, 536,
Traditionally reserved]
|
NU
Deprecated.
|
NZ
Deprecated.
New Zealand
[NZ, NZL, 554,
Officially assigned]
|
OM
Deprecated.
|
PA
Deprecated.
|
PE
Deprecated.
|
PF
Deprecated.
French Polynesia
[PF, PYF, 258,
Officially assigned]
|
PG
Deprecated.
Papua New Guinea
[PG, PNG, 598,
Officially assigned]
|
PH
Deprecated.
Philippines
[PH, PHL, 608,
Officially assigned]
|
PK
Deprecated.
|
PL
Deprecated.
|
PM
Deprecated.
Saint Pierre and Miquelon
[PM, SPM, 666,
Officially assigned]
|
PN
Deprecated.
|
PR
Deprecated.
Puerto Rico
[PR, PRI, 630,
Officially assigned]
|
PS
Deprecated.
Palestine, State of
[PS, PSE, 275,
Officially assigned]
|
PT
Deprecated.
|
PW
Deprecated.
|
PY
Deprecated.
|
QA
Deprecated.
|
RE
Deprecated.
|
RO
Deprecated.
|
RS
Deprecated.
|
RU
Deprecated.
Russian Federation
[RU, RUS, 643,
Officially assigned]
|
RW
Deprecated.
|
SA
Deprecated.
Saudi Arabia
[SA, SAU, 682,
Officially assigned]
|
SB
Deprecated.
Solomon Islands
[SB, SLB, 90,
Officially assigned]
|
SC
Deprecated.
Seychelles
[SC, SYC, 690,
Officially assigned]
|
SD
Deprecated.
|
SE
Deprecated.
|
SF
Deprecated.
|
SG
Deprecated.
|
SH
Deprecated.
Saint Helena, Ascension and Tristan da Cunha
[SH, SHN, 654,
Officially assigned]
|
SI
Deprecated.
|
SJ
Deprecated.
Svalbard and Jan Mayen
[SJ, SJM, 744,
Officially assigned]
|
SK
Deprecated.
|
SL
Deprecated.
Sierra Leone
[SL, SLE, 694,
Officially assigned]
|
SM
Deprecated.
San Marino
[SM, SMR, 674,
Officially assigned]
|
SN
Deprecated.
|
SO
Deprecated.
|
SR
Deprecated.
|
SS
Deprecated.
South Sudan
[SS, SSD, 728,
Officially assigned]
|
ST
Deprecated.
Sao Tome and Principe
[ST, STP, 678,
Officially assigned]
|
SU
Deprecated.
|
SV
Deprecated.
El Salvador
[SV, SLV, 222,
Officially assigned]
|
SX
Deprecated.
Sint Maarten (Dutch part)
[SX, SXM, 534,
Officially assigned]
|
SY
Deprecated.
Syrian Arab Republic
[SY, SYR, 760,
Officially assigned]
|
SZ
Deprecated.
|
TA
Deprecated.
Tristan da Cunha
[TA, TAA, -1,
Exceptionally reserved.
|
TC
Deprecated.
Turks and Caicos Islands
[TC, TCA, 796,
Officially assigned]
|
TD
Deprecated.
|
TF
Deprecated.
French Southern Territories
[TF, ATF, 260,
Officially assigned]
|
TG
Deprecated.
|
TH
Deprecated.
|
TJ
Deprecated.
Tajikistan
[TJ, TJK, 762,
Officially assigned]
|
TK
Deprecated.
|
TL
Deprecated.
Timor-Leste
[TL, TLS, 626,
Officially assigned]
|
TM
Deprecated.
Turkmenistan
[TM, TKM, 795,
Officially assigned]
|
TN
Deprecated.
|
TO
Deprecated.
|
TP
Deprecated.
East Timor
[TP, TPTL, 0,
Traditionally reserved]
|
TR
Deprecated.
|
TT
Deprecated.
Trinidad and Tobago
[TT, TTO, 780,
Officially assigned]
|
TV
Deprecated.
|
TW
Deprecated.
Taiwan, Province of China
[TW, TWN, 158,
Officially assigned]
|
TZ
Deprecated.
Tanzania, United Republic of
[TZ, TZA, 834,
Officially assigned]
|
UA
Deprecated.
|
UG
Deprecated.
|
UK
Deprecated.
United Kingdom
[UK, null, -1,
Exceptionally reserved]
|
UM
Deprecated.
United States Minor Outlying Islands
[UM, UMI, 581,
Officially assigned]
|
US
Deprecated.
United States
[US, USA, 840,
Officially assigned]
|
UY
Deprecated.
|
UZ
Deprecated.
Uzbekistan
[UZ, UZB, 860,
Officially assigned]
|
VA
Deprecated.
Holy See (Vatican City State)
[VA, VAT, 336,
Officially assigned]
|
VC
Deprecated.
Saint Vincent and the Grenadines
[VC, VCT, 670,
Officially assigned]
|
VE
Deprecated.
Venezuela, Bolivarian Republic of
[VE, VEN, 862,
Officially assigned]
|
VG
Deprecated.
Virgin Islands, British
[VG, VGB, 92,
Officially assigned]
|
VI
Deprecated.
Virgin Islands, U.S.
[VI, VIR, 850,
Officially assigned]
|
VN
Deprecated.
|
VU
Deprecated.
|
WF
Deprecated.
Wallis and Futuna
[WF, WLF, 876,
Officially assigned]
|
WS
Deprecated.
|
XK
Deprecated.
Kosovo, Republic of
[XK, XXK, -1,
User assigned]
|
YE
Deprecated.
|
YT
Deprecated.
|
YU
Deprecated.
Yugoslavia
[YU, YUCS, 890,
Traditionally reserved]
|
ZA
Deprecated.
South Africa
[ZA, ZAF, 710,
Officially assigned]
|
ZM
Deprecated.
|
ZR
Deprecated.
|
ZW
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static java.util.List<LDCountryCode> |
findByName(java.util.regex.Pattern pattern)
Deprecated.
Get a list of
CountryCode by a name pattern. |
static java.util.List<LDCountryCode> |
findByName(java.lang.String regex)
Deprecated.
Get a list of
CountryCode by a name regular expression. |
java.lang.String |
getAlpha2()
Deprecated.
Get the ISO 3166-1 alpha-2 code.
|
java.lang.String |
getAlpha3()
Deprecated.
Get the ISO 3166-1 alpha-3 code.
|
com.launchdarkly.android.LDCountryCode.Assignment |
getAssignment()
Deprecated.
Get the assignment state of this country code in ISO 3166-1.
|
static LDCountryCode |
getByCode(int code)
Deprecated.
Get a
CountryCode that corresponds to the given
ISO 3166-1
numeric code. |
static LDCountryCode |
getByCode(java.lang.String code)
Deprecated.
|
static LDCountryCode |
getByCode(java.lang.String code,
boolean caseSensitive)
Deprecated.
|
static LDCountryCode |
getByCodeIgnoreCase(java.lang.String code)
Deprecated.
|
static LDCountryCode |
getByLocale(java.util.Locale locale)
Deprecated.
Get a
CountryCode that corresponds to the country code of
the given Locale instance. |
java.util.Currency |
getCurrency()
Deprecated.
Get the currency.
|
java.lang.String |
getName()
Deprecated.
Get the country name.
|
int |
getNumeric()
Deprecated.
Get the ISO 3166-1 numeric code.
|
java.util.Locale |
toLocale()
Deprecated.
Convert this
CountryCode instance to a Locale instance. |
static LDCountryCode |
valueOf(java.lang.String name)
Deprecated.
Returns the enum constant of this type with the specified name.
|
static LDCountryCode[] |
values()
Deprecated.
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LDCountryCode AC
public static final LDCountryCode AD
public static final LDCountryCode AE
public static final LDCountryCode AF
public static final LDCountryCode AG
public static final LDCountryCode AI
public static final LDCountryCode AL
public static final LDCountryCode AM
public static final LDCountryCode AN
public static final LDCountryCode AO
public static final LDCountryCode AQ
public static final LDCountryCode AR
public static final LDCountryCode AS
public static final LDCountryCode AT
public static final LDCountryCode AU
public static final LDCountryCode AW
public static final LDCountryCode AX
public static final LDCountryCode AZ
public static final LDCountryCode BA
public static final LDCountryCode BB
public static final LDCountryCode BD
public static final LDCountryCode BE
public static final LDCountryCode BF
public static final LDCountryCode BG
public static final LDCountryCode BH
public static final LDCountryCode BI
public static final LDCountryCode BJ
public static final LDCountryCode BL
public static final LDCountryCode BM
public static final LDCountryCode BN
public static final LDCountryCode BO
public static final LDCountryCode BQ
public static final LDCountryCode BR
public static final LDCountryCode BS
public static final LDCountryCode BT
public static final LDCountryCode BU
MM
public static final LDCountryCode BV
public static final LDCountryCode BW
public static final LDCountryCode BY
public static final LDCountryCode BZ
public static final LDCountryCode CA
public static final LDCountryCode CC
public static final LDCountryCode CD
public static final LDCountryCode CF
public static final LDCountryCode CG
public static final LDCountryCode CH
public static final LDCountryCode CI
public static final LDCountryCode CK
public static final LDCountryCode CL
public static final LDCountryCode CM
public static final LDCountryCode CN
public static final LDCountryCode CO
public static final LDCountryCode CP
public static final LDCountryCode CR
public static final LDCountryCode CS
public static final LDCountryCode CU
public static final LDCountryCode CV
public static final LDCountryCode CW
public static final LDCountryCode CX
public static final LDCountryCode CY
public static final LDCountryCode CZ
public static final LDCountryCode DE
public static final LDCountryCode DG
public static final LDCountryCode DJ
public static final LDCountryCode DK
public static final LDCountryCode DM
public static final LDCountryCode DO
public static final LDCountryCode DZ
public static final LDCountryCode EA
public static final LDCountryCode EC
public static final LDCountryCode EE
public static final LDCountryCode EG
public static final LDCountryCode EH
public static final LDCountryCode ER
public static final LDCountryCode ES
public static final LDCountryCode ET
public static final LDCountryCode EU
public static final LDCountryCode FI
SF
public static final LDCountryCode FJ
public static final LDCountryCode FK
public static final LDCountryCode FM
public static final LDCountryCode FO
public static final LDCountryCode FR
public static final LDCountryCode FX
public static final LDCountryCode GA
public static final LDCountryCode GB
public static final LDCountryCode GD
public static final LDCountryCode GE
public static final LDCountryCode GF
public static final LDCountryCode GG
public static final LDCountryCode GH
public static final LDCountryCode GI
public static final LDCountryCode GL
public static final LDCountryCode GM
public static final LDCountryCode GN
public static final LDCountryCode GP
public static final LDCountryCode GQ
public static final LDCountryCode GR
public static final LDCountryCode GS
public static final LDCountryCode GT
public static final LDCountryCode GU
public static final LDCountryCode GW
public static final LDCountryCode GY
public static final LDCountryCode HK
public static final LDCountryCode HM
public static final LDCountryCode HN
public static final LDCountryCode HR
public static final LDCountryCode HT
public static final LDCountryCode HU
public static final LDCountryCode IC
public static final LDCountryCode ID
public static final LDCountryCode IE
public static final LDCountryCode IL
public static final LDCountryCode IM
public static final LDCountryCode IN
public static final LDCountryCode IO
public static final LDCountryCode IQ
public static final LDCountryCode IR
public static final LDCountryCode IS
public static final LDCountryCode IT
public static final LDCountryCode JE
public static final LDCountryCode JM
public static final LDCountryCode JO
public static final LDCountryCode JP
public static final LDCountryCode KE
public static final LDCountryCode KG
public static final LDCountryCode KH
public static final LDCountryCode KI
public static final LDCountryCode KM
public static final LDCountryCode KN
public static final LDCountryCode KP
public static final LDCountryCode KR
public static final LDCountryCode KW
public static final LDCountryCode KY
public static final LDCountryCode KZ
public static final LDCountryCode LA
public static final LDCountryCode LB
public static final LDCountryCode LC
public static final LDCountryCode LI
public static final LDCountryCode LK
public static final LDCountryCode LR
public static final LDCountryCode LS
public static final LDCountryCode LT
public static final LDCountryCode LU
public static final LDCountryCode LV
public static final LDCountryCode LY
public static final LDCountryCode MA
public static final LDCountryCode MC
public static final LDCountryCode MD
public static final LDCountryCode ME
public static final LDCountryCode MF
public static final LDCountryCode MG
public static final LDCountryCode MH
public static final LDCountryCode MK
public static final LDCountryCode ML
public static final LDCountryCode MM
BU
public static final LDCountryCode MN
public static final LDCountryCode MO
public static final LDCountryCode MP
public static final LDCountryCode MQ
public static final LDCountryCode MR
public static final LDCountryCode MS
public static final LDCountryCode MT
public static final LDCountryCode MU
public static final LDCountryCode MV
public static final LDCountryCode MW
public static final LDCountryCode MX
public static final LDCountryCode MY
public static final LDCountryCode MZ
public static final LDCountryCode NA
public static final LDCountryCode NC
public static final LDCountryCode NE
public static final LDCountryCode NF
public static final LDCountryCode NG
public static final LDCountryCode NI
public static final LDCountryCode NL
public static final LDCountryCode NO
public static final LDCountryCode NP
public static final LDCountryCode NR
public static final LDCountryCode NT
public static final LDCountryCode NU
public static final LDCountryCode NZ
public static final LDCountryCode OM
public static final LDCountryCode PA
public static final LDCountryCode PE
public static final LDCountryCode PF
public static final LDCountryCode PG
public static final LDCountryCode PH
public static final LDCountryCode PK
public static final LDCountryCode PL
public static final LDCountryCode PM
public static final LDCountryCode PN
public static final LDCountryCode PR
public static final LDCountryCode PS
public static final LDCountryCode PT
public static final LDCountryCode PW
public static final LDCountryCode PY
public static final LDCountryCode QA
public static final LDCountryCode RE
public static final LDCountryCode RO
public static final LDCountryCode RS
public static final LDCountryCode RU
public static final LDCountryCode RW
public static final LDCountryCode SA
public static final LDCountryCode SB
public static final LDCountryCode SC
public static final LDCountryCode SD
public static final LDCountryCode SE
public static final LDCountryCode SF
FI
public static final LDCountryCode SG
public static final LDCountryCode SH
public static final LDCountryCode SI
public static final LDCountryCode SJ
public static final LDCountryCode SK
public static final LDCountryCode SL
public static final LDCountryCode SM
public static final LDCountryCode SN
public static final LDCountryCode SO
public static final LDCountryCode SR
public static final LDCountryCode SS
public static final LDCountryCode ST
public static final LDCountryCode SU
public static final LDCountryCode SV
public static final LDCountryCode SX
public static final LDCountryCode SY
public static final LDCountryCode SZ
public static final LDCountryCode TA
public static final LDCountryCode TC
public static final LDCountryCode TD
public static final LDCountryCode TF
public static final LDCountryCode TG
public static final LDCountryCode TH
public static final LDCountryCode TJ
public static final LDCountryCode TK
public static final LDCountryCode TL
public static final LDCountryCode TM
public static final LDCountryCode TN
public static final LDCountryCode TO
public static final LDCountryCode TP
public static final LDCountryCode TR
public static final LDCountryCode TT
public static final LDCountryCode TV
public static final LDCountryCode TW
public static final LDCountryCode TZ
public static final LDCountryCode UA
public static final LDCountryCode UG
public static final LDCountryCode UK
public static final LDCountryCode UM
public static final LDCountryCode US
public static final LDCountryCode UY
public static final LDCountryCode UZ
public static final LDCountryCode VA
public static final LDCountryCode VC
public static final LDCountryCode VE
public static final LDCountryCode VG
public static final LDCountryCode VI
public static final LDCountryCode VN
public static final LDCountryCode VU
public static final LDCountryCode WF
public static final LDCountryCode WS
public static final LDCountryCode XK
public static final LDCountryCode YE
public static final LDCountryCode YT
public static final LDCountryCode YU
public static final LDCountryCode ZA
public static final LDCountryCode ZM
public static final LDCountryCode ZR
public static final LDCountryCode ZW
public static LDCountryCode[] values()
for (LDCountryCode c : LDCountryCode.values()) System.out.println(c);
public static LDCountryCode valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String getName()
public java.lang.String getAlpha2()
public java.lang.String getAlpha3()
EU
)
returns null
.public int getNumeric()
EU
)
returns -1
.public com.launchdarkly.android.LDCountryCode.Assignment getAssignment()
public java.util.Locale toLocale()
CountryCode
instance to a Locale
instance.
In most cases, this method creates a new Locale
instance
every time it is called, but some CountryCode
instances return
their corresponding entries in Locale
class. For example,
CountryCode.CA
always returns Locale.CANADA
.
The table below lists CountryCode
entries whose toLocale()
do not create new Locale instances but return entries in
Locale
class.
CountryCode | Locale |
---|---|
CountryCode.CA |
Locale.CANADA |
CountryCode.CN |
Locale.CHINA |
CountryCode.DE |
Locale.GERMANY |
CountryCode.FR |
Locale.FRANCE |
CountryCode.GB |
Locale.UK |
CountryCode.IT |
Locale.ITALY |
CountryCode.JP |
Locale.JAPAN |
CountryCode.KR |
Locale.KOREA |
CountryCode.TW |
Locale.TAIWAN |
CountryCode.US |
Locale.US |
Locale
instance that matches this CountryCode
.public java.util.Currency getCurrency()
This method is an alias of Currency
.
getInstance
(
toLocale()
)
. The only difference is that this method
returns null
when Currency.getInstance(Locale)
throws IllegalArgumentException
.
This method returns null
when the territory represented by
this CountryCode
instance does not have a currency.
AQ
(Antarctica) is one example.
In addition, this method returns null
also when the ISO 3166
code represented by this CountryCode
instance is not
supported by the implementation of Currency.getInstance(Locale)
. At the time of this writing,
SS
(South Sudan) is one example.
Currency
instance. In some cases, null
is returned.Currency.getInstance(Locale)
public static LDCountryCode getByCode(java.lang.String code)
CountryCode
that corresponds to the given ISO 3166-1
alpha-2 or
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 of getByCode(code, false)
.
code
- An ISO 3166-1 alpha-2 or alpha-3 code.CountryCode
instance, or null
if not found.getByCode(String, boolean)
public static LDCountryCode getByCodeIgnoreCase(java.lang.String code)
CountryCode
that corresponds to the given ISO 3166-1
alpha-2 or
alpha-3 code.
This method calls getByCode
(code, false)
.
code
- An ISO 3166-1 alpha-2 or alpha-3 code.CountryCode
instance, or null
if not found.getByCode(String, boolean)
public static LDCountryCode getByCode(java.lang.String code, boolean caseSensitive)
code
- An ISO 3166-1 alpha-2 or alpha-3 code.caseSensitive
- If true
, the given code should consist of upper-case letters only.
If false
, this method internally canonicalizes the given code by
String.toUpperCase()
and then performs search. For example,
getByCode("jp", true)
returns null
, but on the other hand,
getByCode("jp", false)
returns CountryCode.JP
.CountryCode
instance, or null
if not found.public static LDCountryCode getByLocale(java.util.Locale locale)
CountryCode
that corresponds to the country code of
the given Locale
instance.locale
- A Locale
instance.CountryCode
instance, or null
if not found.Locale.getCountry()
public static LDCountryCode getByCode(int code)
CountryCode
that corresponds to the given
ISO 3166-1
numeric code.code
- An ISO 3166-1 numeric code.CountryCode
instance, or null
if not found.
If 0 or a negative value is given, null
is returned.public static java.util.List<LDCountryCode> findByName(java.lang.String regex)
CountryCode
by a name regular expression.
This method is almost equivalent to findByName
(Pattern.compile(regex))
.
regex
- Regular expression for names.CountryCode
. If nothing has matched,
an empty list is returned.java.lang.IllegalArgumentException
- regex
is null
.java.util.regex.PatternSyntaxException
- regex
failed to be compiled.public static java.util.List<LDCountryCode> findByName(java.util.regex.Pattern pattern)
CountryCode
by a name pattern.
For example, the list obtained by the code snippet below:
Pattern pattern = Pattern.compile(".*United.*");
List<CountryCode> list = CountryCode.findByName(pattern);
contains 6 CountryCode
s as listed below.
pattern
- Pattern to match names.CountryCode
. If nothing has matched,
an empty list is returned.java.lang.IllegalArgumentException
- pattern
is null
.