Class CountryCode

java.lang.Object
org.episteme.core.util.ExtensibleEnum
org.episteme.social.politics.CountryCode
All Implemented Interfaces:
Serializable, Comparable<ExtensibleEnum>

public final class CountryCode extends ExtensibleEnum
Extensible listing of Country Codes (ISO 3166-1 alpha-2).

Values are loaded dynamically from a JSON resource via CountryCodesReader. To access a country code, use valueOf(String).

Since:
2.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • CountryCode

      public CountryCode(String code, String englishName, boolean builtIn)
      Constructor used by the Reader.
      Parameters:
      code - The ISO 2-letter code (used as name).
      englishName - The English name.
      builtIn - Whether it is a built-in code.
  • Method Details

    • isBuiltIn

      public boolean isBuiltIn()
      Description copied from class: ExtensibleEnum
      Checks if this is a built-in (predefined) value. Default implementation returns true to mimic standard Enum behavior unless explicitly overridden.
      Overrides:
      isBuiltIn in class ExtensibleEnum
    • getEnglishName

      public String getEnglishName()
    • valueOf

      public static CountryCode valueOf(String name)
      Returns the CountryCode corresponding to the specified name (code).
      Parameters:
      name - The code name (e.g. "US").
      Returns:
      The CountryCode instance.
      Throws:
      IllegalArgumentException - if not found.
    • values

      public static CountryCode[] values()