Market
ISO 3166-1 country code.
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 Market instance that corresponds to a given alpha-2/alpha-3/numeric code (.getByCode, .getByCode).
// List all the country codes. for (Market code : Market.values()) { // For example, "[US] United States" is printed. System.out.format("[%s] %s\n", code, code.[.getName]); } // Get a Market instance by ISO 3166-1 code. Market code = Market.[getByCode][.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. // Get a Market by a Locale instance. code = Market.[getByLocale][.getByLocale](locale); // Get the currency of the country. // Get a list by a regular expression for names. // // The list will contain: // // Market.AE ed Arab Emirates // Market.GB ed Kingdom // Market.TZ : Tanzania, United Republic of // Market.UK ed Kingdom // Market.UM ed States Minor Outlying Islands // Market.US ed States // List<Market> list = Market.[findByName][.findByName](".*United.*"); // For backward compatibility for older versions than 1.16, some // 4-letter ISO 3166-3 codes are accepted by getByCode(String, boolean) // and its variants. To be concrete: // // [ANHH](https://en.wikipedia.org/wiki/ISO_3166-3#ANHH) : Market.AN // [BUMM](https://en.wikipedia.org/wiki/ISO_3166-3#BUMM) : Market.BU // [CSXX](https://en.wikipedia.org/wiki/ISO_3166-3#CSXX) : Market.CS // [NTHH](https://en.wikipedia.org/wiki/ISO_3166-3#NTHH) : Market.NT // [TPTL](https://en.wikipedia.org/wiki/ISO_3166-3#TPTL) : Market.TP // [YUCS](https://en.wikipedia.org/wiki/ISO_3166-3#YUCS) : Market.YU // [ZRCD](https://en.wikipedia.org/wiki/ISO_3166-3#ZRCD) : Market.ZR // code = Market.[getByCode][.getByCode]("ANHH");*
Author
Takahiko Kawasaki (https://github.com/TakahikoKawasaki/nv-i18n)
Entries
ZR
Link copied to clipboard
ZR("Zaire", "ZAR", 180, Assignment.TRANSITIONALLY_RESERVED)
Content copied to clipboard
ZaireMarket Code: ZRSince version 1.
YU
Link copied to clipboard
YU("Yugoslavia", "YUG", 890, Assignment.TRANSITIONALLY_RESERVED)
Content copied to clipboard
YugoslaviaMarket Code: YUSince version 1.
UK
Link copied to clipboard
UK("United Kingdom", null, 826, Assignment.EXCEPTIONALLY_RESERVED)
Content copied to clipboard
United KingdomMarket Code: UKSince version 1.17, the numeric code of this entry is 826.
TP
Link copied to clipboard
TP("East Timor", "TMP", 626, Assignment.TRANSITIONALLY_RESERVED)
Content copied to clipboard
East TimorMarket Code: TPSince version 1.
TA
Link copied to clipboard
TA("Tristan da Cunha", "TAA", -1, Assignment.EXCEPTIONALLY_RESERVED)
Content copied to clipboard
Tristan da Cunha [TA, TAA, -1, Exceptionally reserved.
SU
Link copied to clipboard
SU("USSR", "SUN", 810, Assignment.EXCEPTIONALLY_RESERVED)
Content copied to clipboard
USSRMarket Code: SUSince version 1.17, the numeric code of this entry is 810.
NT
Link copied to clipboard
NT("Neutral Zone", "NTZ", 536, Assignment.TRANSITIONALLY_RESERVED)
Content copied to clipboard
Neutral ZoneMarket Code: NTSince version 1.
FX
Link copied to clipboard
FX("France, Metropolitan", "FXX", 249, Assignment.EXCEPTIONALLY_RESERVED)
Content copied to clipboard
France, MetropolitanMarket Code: FXSince version 1.17, the numeric code of this entry is 249.
CS
Link copied to clipboard
CS("Serbia and Montenegro", "SCG", 891, Assignment.TRANSITIONALLY_RESERVED)
Content copied to clipboard
Serbia and MontenegroMarket Code: CSSince version 1.
BU
Link copied to clipboard
BU("Burma", "BUR", 104, Assignment.TRANSITIONALLY_RESERVED)
Content copied to clipboard
BurmaMarket Code: BUSince version 1.
AX
Link copied to clipboard
AX("\u00C5land Islands", "ALA", 248, Assignment.OFFICIALLY_ASSIGNED)
Content copied to clipboard
land IslandsMarket Code: AXThe country name was changed from "\u212Bland Islands" (up to 1.14) to "\u00C5land Islands" (since 1.15).
AN
Link copied to clipboard
AN("Netherlands Antilles", "ANT", 530, Assignment.TRANSITIONALLY_RESERVED)
Content copied to clipboard
Netherlands AntillesMarket Code: ANSince version 1.
Types
Assignment
Link copied to clipboard
Properties
alpha3
Link copied to clipboard
assignment
Link copied to clipboard
marketName
Link copied to clipboard
numeric
Link copied to clipboard
Sources
common source
Link copied to clipboard