Interface IntegrationLocalizationService
- All Known Implementing Classes:
DefaultIntegrationLocalizationService
public interface IntegrationLocalizationService
A service for determining locale specific information for the integration purposes.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves all locales supported by the platformRetrieves a locale to be used when the locale is not explicitly specified for the incoming/outgoing integration data.getSupportedLocale(String isoCode) Retrieves a locale supported by the platform, which corresponds to the specified ISO code.getSupportedLocaleForLanguageTag(String languageTag) Creates a Locale for the provided language tag, and verifies that the locale is supported.voidvalidateLocale(Locale locale) Validates the locale language matches corresponds to an existing LanguageModel.
-
Method Details
-
getSupportedLocale
Retrieves a locale supported by the platform, which corresponds to the specified ISO code.- Parameters:
isoCode- an <a href=https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes">ISO code, for which aLocaleshould be retrieved.- Returns:
- an
Optionalcontaining theLocale, if the ISO code is valid and is supported by the platform; otherwise,Optional.empty()is returned.
-
getAllSupportedLocales
Collection<Locale> getAllSupportedLocales()Retrieves all locales supported by the platform- Returns:
- a list of all locales, which could be used with integration objects data.
-
getDefaultLocale
Locale getDefaultLocale()Retrieves a locale to be used when the locale is not explicitly specified for the incoming/outgoing integration data.- Returns:
- a default locale to use when no explicit locale specified.
-
validateLocale
Validates the locale language matches corresponds to an existing LanguageModel.- Parameters:
locale- - the locale that is being validated
-
getSupportedLocaleForLanguageTag
Creates a Locale for the provided language tag, and verifies that the locale is supported. Implementations are expected to throw an exception if the langaugeTag is not supported.- Parameters:
languageTag- - language tag that holds information used to construct a Locale- Returns:
- - a supported Locale for the languageTag
-