Package es.gob.afirma.tsl.utils
Class UtilsCountryLanguage
- java.lang.Object
-
- es.gob.afirma.tsl.utils.UtilsCountryLanguage
-
public final class UtilsCountryLanguage extends java.lang.ObjectClass 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.StringES_COUNTRY_CODEConstant attribute that represents the region code 'ES' for 'Spain'.static java.lang.StringES_COUNTRY_NAMEConstant 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 booleancheckCountryCode(java.lang.String countryCode)Checks if the input parameter is a string taht represents a country code specified in ISO 3166.static booleancheckLanguageCode(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.StringgetFirstLocaleCountryNameOfCountryCode(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.LocalegetFirstLocaleOfCountryCode(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).
-
-
-
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:
trueif the input parameter represents a country code in ISO 3166. Otherwisefalse.
-
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:
trueif the input parameter represents a language code in ISO 639 (not stable standard). Otherwisefalse.
-
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.
-
-