Class LocaleUtils


  • public class LocaleUtils
    extends Object
    Utilities for locale
    Author:
    markr
    • Field Detail

      • countries2ISO

        protected static final Map<String,​String> countries2ISO
        store mapping from full name to iso2 code
    • Constructor Detail

      • LocaleUtils

        public LocaleUtils()
    • Method Detail

      • getIso2CountryCodeByName

        public static String getIso2CountryCodeByName​(String countryName)
        Parameters:
        countryName - (full name as per English locale)
        Returns:
        ISO2 code, null if incorrect name
      • getCountryNameCodeByIso2Code

        public static String getCountryNameCodeByIso2Code​(String iso2Code)
        collect full name of country based on ISO2 code
        Parameters:
        iso2Code - country code
        Returns:
        full name under English Locale