Class HeapBasedLocalizationStorage

java.lang.Object
org.somda.sdc.glue.provider.localization.helper.HeapBasedLocalizationStorage
All Implemented Interfaces:
LocalizationStorage

public class HeapBasedLocalizationStorage extends Object implements LocalizationStorage
Default implementation of LocalizationStorage.

Localized texts are stored in heap (Map) and can be added during runtime.

  • Constructor Details

    • HeapBasedLocalizationStorage

      public HeapBasedLocalizationStorage()
  • Method Details

    • getSupportedLanguages

      public List<String> getSupportedLanguages()
      Description copied from interface: LocalizationStorage
      Gets a list of all supported languages.
      Specified by:
      getSupportedLanguages in interface LocalizationStorage
      Returns:
      a list of supported language identifiers.
    • getLocalizedText

      public List<LocalizedText> getLocalizedText(List<String> references, @Nullable BigInteger version, List<String> languages)
      Description copied from interface: LocalizationStorage
      Gets a localized text that is referenced in the MDIB.
      Specified by:
      getLocalizedText in interface LocalizationStorage
      Parameters:
      references - a zero or more reference names of the texts that are requested. If empty list is provided localized texts are not filtered by reference.
      version - of the referenced text that is requested. The latest version is used if parameter is null.
      languages - a zero or more language identifiers to get different translations of the requested text. If empty list is provided localized texts are not filtered by language.
      Returns:
      a list of LocalizedText texts that matches search criteria.
    • addLocalizedText

      public void addLocalizedText(LocalizedText text)
      Adds provided localized text to the LocalizationStorage.
      Parameters:
      text - the LocalizedText to be added to the storage.
    • addAllLocalizedTexts

      public void addAllLocalizedTexts(Collection<LocalizedText> texts)
      Adds provided collection of localized texts to the LocalizationStorage.
      Parameters:
      texts - a collection of LocalizedText to be added to the storage.