Interface ILocalizationProviding<TBase extends de.xima.cmn.dao.interfaces.IEntity<Long>,​TLocale extends ILocalization<TBase>>

  • Type Parameters:
    TBase - type of the base entity that is providing localization.
    TLocale - type of the localization.
    All Known Implementing Classes:
    ClientPortalConfig, Projekt, UserPortal, UserPortalAuthConfig, UserPortalState, UserPortalTag

    public interface ILocalizationProviding<TBase extends de.xima.cmn.dao.interfaces.IEntity<Long>,​TLocale extends ILocalization<TBase>>
    Common interface for all objects (mainly entities) that have got localisation entities for the purpose of internationalisation.
    Since:
    8.2.0
    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • getLocalizations

        List<TLocale> getLocalizations()
        Gets the localisation entities
        Returns:
        the localisation entities
      • setLocalizations

        void setLocalizations​(List<TLocale> entities)
        Sets the i18n name
        Parameters:
        entities - the entities for localisation to set
      • getFallbackLocale

        Locale getFallbackLocale()
        Gets the default locale to use as a fallback when a localization is missing for a locale. May return null if the object does not provide a fallback locale.
        Returns:
        the default locale to use as a fallback when a localization is missing for a locale
      • getLocalizationsByI18nName

        default Map<String,​Map<Locale,​String>> getLocalizationsByI18nName()
        Gets the localizations grouped by the I18N name (map key).
        Returns:
        the localizations grouped by the I18N name (map key) as an immutable map.
      • getLocalizationsByLocale

        default Map<Locale,​Map<String,​String>> getLocalizationsByLocale()
        Gets the localizations grouped by the locale (map key).
        Returns:
        the localizations grouped by the locale (map key) as an immutable map.
      • getI18nNames

        default Set<String> getI18nNames()
        Gets the i18n names provided by this object.
        Returns:
        the i18n names provided by this object
      • getLocalizationsByI18nName

        default Map<String,​Map<Locale,​String>> getLocalizationsByI18nName​(Locale fallbackLocale)
        Gets the localizations grouped by the I18N name (map key).
        Parameters:
        fallbackLocale - to get the localizations from if a localization is missing for a locale
        Returns:
        the localizations grouped by the I18N name (map key) as an immutable map.
      • getLocalizationsByI18nName

        default Map<Locale,​String> getLocalizationsByI18nName​(String i18nName)
        Gets the localizations for the given I18N name.
        Parameters:
        i18nName - to get the localizations for
        Returns:
        the localizations for the given I18N name as an immutable map.
      • getLocalizationsByI18nName

        default Map<Locale,​String> getLocalizationsByI18nName​(String i18nName,
                                                                    Locale fallbackLocale)
        Gets the localizations for the given I18N name.
        Parameters:
        i18nName - to get the localizations for
        fallbackLocale - to get the localizations from if the localization for the given locale is missing
        Returns:
        the localizations for the given I18N name as an immutable map.
      • getLocalizationsByLocale

        default Map<Locale,​Map<String,​String>> getLocalizationsByLocale​(Locale fallbackLocale)
        Gets the localizations grouped by the locale (map key). Uses the messages from the given fallback locale when a message is missing for the given locale.
        Parameters:
        fallbackLocale - to get the localizations from if a localization is missing for a locale
        Returns:
        the localizations grouped by the locale (map key) as an immutable map.
      • getLocalizationsForLocale

        default Map<String,​String> getLocalizationsForLocale​(Locale locale)
        Gets the localizations for the given locale.
        Parameters:
        locale - to get the localizations for.
        Returns:
        the localizations for the given locale as an immutable map.
      • getLocalizationsForLocale

        default Map<String,​String> getLocalizationsForLocale​(Locale locale,
                                                                   Locale fallbackLocale)
        Gets the localizations for the given locale. Uses the messages from the given fallback locale when a message is missing for the given locale.
        Parameters:
        locale - to get the localizations for.
        fallbackLocale - to get the localizations from if the localization for the given locale is missing
        Returns:
        the localizations for the given locale as an immutable map.
      • getLocalization

        default String getLocalization​(String i18nName,
                                       Locale locale)
        Gets the localized string for the given I18N name and locale.
        Parameters:
        i18nName - to get the localization for
        locale - to get the localization for.
        Returns:
        The localization for the given I18N name and locale
      • getLocalization

        default String getLocalization​(String i18nName,
                                       Locale locale,
                                       Locale fallbackLocale)
        Gets the localized string for the given I18N name and locale.
        Parameters:
        i18nName - to get the localization for
        locale - to get the localization for.
        fallbackLocale - to get the localization from if the localization for the given locale is missing
        Returns:
        The localization for the given I18N name and locale
      • getLocalizationObject

        default TLocale getLocalizationObject​(String i18nName,
                                              Locale locale)
        Gets the localization object for the given I18N name and locale.
        Parameters:
        i18nName - to get the localization for
        locale - to get the localization for.
        Returns:
        The localization for the given I18N name and locale
      • getLocalizationObject

        default TLocale getLocalizationObject​(String i18nName,
                                              Locale locale,
                                              Locale fallbackLocale)
        Gets the localization object for the given I18N name and locale.
        Parameters:
        i18nName - to get the localization for
        locale - to get the localization for.
        fallbackLocale - to get the localization from if the localization for the given locale is missing
        Returns:
        The localization for the given I18N name and locale