Enum ECountry

java.lang.Object
java.lang.Enum<ECountry>
com.helger.commons.locale.country.ECountry
All Implemented Interfaces:
IHasID<String>, IHasDisplayText, Serializable, Comparable<ECountry>, java.lang.constant.Constable

public enum ECountry extends Enum<ECountry> implements IHasDisplayText, IHasID<String>
Country enum.
Author:
Philip Helger
  • Enum Constant Details

  • Method Details

    • values

      public static ECountry[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ECountry 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
    • getID

      @Nonnull public String getID()
      Description copied from interface: IHasID
      Get the unique ID of this object. If the type is String than the returned value must match an XML NMToken expression (so e.g. no ':' in the ID)!
      Specified by:
      getID in interface IHasID<String>
      Returns:
      the country ID (incl. all state information). Always lowercase!
    • getISOCountryCode

      @Nonnull public String getISOCountryCode()
      Returns:
      the ISO country code (the part before the first underscore). Always lowercase.
    • getDisplayText

      @Nullable public String getDisplayText(@Nonnull Locale aContentLocale)
      Specified by:
      getDisplayText in interface IHasDisplayText
      Parameters:
      aContentLocale - The locale to be used for resolving. May not be null.
      Returns:
      The display text of the object in the given locale. May be null if the text could not be resolved in the passed locale.
    • isCountrySub

      public boolean isCountrySub()
    • getAsLocale

      public Locale getAsLocale()
    • getFromIDOrNull

      @Nullable public static ECountry getFromIDOrNull(@Nullable String sID)
    • getFromISOCodeOrNull

      @Nullable public static ECountry getFromISOCodeOrNull(@Nullable String sISO)
      Try to find the country with the passed ISO code. Country sub-codes are ignored in this method.
      Parameters:
      sISO - The ISO code to search. Case sensitivity does not matter. May be null.
      Returns:
      The matching country or null if the ISO code was not resolved.
    • getCountryListAsLocales

      @Nonnull @ReturnsMutableCopy public static ICommonsSet<Locale> getCountryListAsLocales()
      Returns:
      A non-null set of all contained country locales in this enumeration.