Enum CountryCode

  • All Implemented Interfaces:
    Serializable, Comparable<CountryCode>

    public enum CountryCode
    extends Enum<CountryCode>
    This enumeration gives the official codes of the countries given by the ISO 3166-1.
    Since:
    14.0
    Version:
    17.0 2020-01-04 14:41:38
    Author:
    Stéphane GALLAND
    Maven Group Id:
    org.arakhne.afc.core
    Maven Artifact Id:
    util
    • Method Detail

      • values

        public static CountryCode[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CountryCode c : CountryCode.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CountryCode valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null
      • getCode

        @Pure
        public String getCode()
        Replies the ISO 3166-1 code for the current country.
        Returns:
        the iso code for the country.
      • fromLocale

        @Pure
        public static CountryCode fromLocale​(Locale locale)
        Replies the country code for the given locale.
        Parameters:
        locale - the locale.
        Returns:
        the country code
      • getLocale

        @Pure
        public Locale getLocale()
        Replies the default locale for the country.
        Returns:
        the default locale for the country.