Class UtilsCountryLanguage


  • public final class UtilsCountryLanguage
    extends java.lang.Object

    Class that provides methods to get or check the country codes and language codes supported by this java version.

    Project:

    Library for the integration with the services of @Firma, eVisor and TS@.

    Version:
    1.0, 10/10/2020.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ES_COUNTRY_CODE
      Constant attribute that represents the region code 'ES' for 'Spain'.
      static java.lang.String ES_COUNTRY_NAME
      Constant attribute that represents the region name 'Spain' for the code 'ES'.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean checkCountryCode​(java.lang.String countryCode)
      Checks if the input parameter is a string taht represents a country code specified in ISO 3166.
      static boolean checkLanguageCode​(java.lang.String languageCode)
      Checks if the input parameter is a string that represents a language code specified in ISO 639 (not stable standard).
      static java.util.Set<java.lang.String> getCountryCodes()
      Gets a set with all the country codes (ISO 3166) and 'EU'.
      static java.lang.String getFirstLocaleCountryNameOfCountryCode​(java.lang.String countryCode)
      Gets the first finded country/region name assigne to the locale associated to the input country code (ISO 3166).
      static java.util.Locale getFirstLocaleOfCountryCode​(java.lang.String countryCode)
      Gets the first finded locale associated to the input country code (ISO 3166).
      static java.util.Set<java.lang.String> getLanguageCodes()
      Gets a set with all the language codes (ISO 639).
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ES_COUNTRY_CODE

        public static final java.lang.String ES_COUNTRY_CODE
        Constant attribute that represents the region code 'ES' for 'Spain'.
        See Also:
        Constant Field Values
      • ES_COUNTRY_NAME

        public static final java.lang.String ES_COUNTRY_NAME
        Constant attribute that represents the region name 'Spain' for the code 'ES'.
        See Also:
        Constant Field Values
    • Method Detail

      • checkCountryCode

        public static boolean checkCountryCode​(java.lang.String countryCode)
        Checks if the input parameter is a string taht represents a country code specified in ISO 3166.
        Parameters:
        countryCode - String with the country code to analyze.
        Returns:
        true if the input parameter represents a country code in ISO 3166. Otherwise false.
      • getCountryCodes

        public static java.util.Set<java.lang.String> getCountryCodes()
        Gets a set with all the country codes (ISO 3166) and 'EU'.
        Returns:
        set of string with all the country codes (ISO 3166) and 'EU'.
      • checkLanguageCode

        public static boolean checkLanguageCode​(java.lang.String languageCode)
        Checks if the input parameter is a string that represents a language code specified in ISO 639 (not stable standard).
        Parameters:
        languageCode - String with the language code to analyze.
        Returns:
        true if the input parameter represents a language code in ISO 639 (not stable standard). Otherwise false.
      • getLanguageCodes

        public static java.util.Set<java.lang.String> getLanguageCodes()
        Gets a set with all the language codes (ISO 639).
        Returns:
        set of string with all the language codes (ISO 639).
      • getFirstLocaleOfCountryCode

        public static java.util.Locale getFirstLocaleOfCountryCode​(java.lang.String countryCode)
        Gets the first finded locale associated to the input country code (ISO 3166).
        Parameters:
        countryCode - Country Code (ISO 3166) from which search the locale.
        Returns:
        first finded locale associated to the input country code (ISO 3166), otherwise null.
      • getFirstLocaleCountryNameOfCountryCode

        public static java.lang.String getFirstLocaleCountryNameOfCountryCode​(java.lang.String countryCode)
        Gets the first finded country/region name assigne to the locale associated to the input country code (ISO 3166). If it is not defined how locale, then try to find it in the additionals country declared.
        Parameters:
        countryCode - Country Code (ISO 3166) from which search the locale.
        Returns:
        first finded country/region name assigne to the locale associated to the input country code (ISO 3166), otherwise null.