Interface IntegrationLocalizationService

All Known Implementing Classes:
DefaultIntegrationLocalizationService

public interface IntegrationLocalizationService
A service for determining locale specific information for the integration purposes.
  • Method Details

    • getSupportedLocale

      Optional<Locale> getSupportedLocale(String isoCode)
      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 a Locale should be retrieved.
      Returns:
      an Optional containing the Locale, 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

      void validateLocale(Locale locale)
      Validates the locale language matches corresponds to an existing LanguageModel.
      Parameters:
      locale - - the locale that is being validated
    • getSupportedLocaleForLanguageTag

      Locale getSupportedLocaleForLanguageTag(String languageTag)
      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