Package org.somda.sdc.glue.common
Class LocalizationServiceFilterUtil
java.lang.Object
org.somda.sdc.glue.common.LocalizationServiceFilterUtil
Utility functions for Localization service.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.common.collect.Multimap<String,LocalizedText> filterByLanguage(com.google.common.collect.Table<String, String, LocalizedText> localizedTextTable, List<String> languages) Filters localized texts by provided languages.static List<LocalizedText>filterByReferences(com.google.common.collect.Multimap<String, LocalizedText> referencesToTextMap, List<String> references) Filter localized texts by provided references.
-
Constructor Details
-
LocalizationServiceFilterUtil
public LocalizationServiceFilterUtil()
-
-
Method Details
-
filterByLanguage
public static com.google.common.collect.Multimap<String,LocalizedText> filterByLanguage(com.google.common.collect.Table<String, String, LocalizedText> localizedTextTable, List<String> languages) Filters localized texts by provided languages.- Parameters:
localizedTextTable- represents table of all available localized texts.languages- list used as filter. If empty list is provided localized texts of all languages are returned.- Returns:
- a map of reference as a key and localized text as a value.
-
filterByReferences
public static List<LocalizedText> filterByReferences(com.google.common.collect.Multimap<String, LocalizedText> referencesToTextMap, List<String> references) Filter localized texts by provided references.- Parameters:
referencesToTextMap- represents a map of reference as a key and localized text as a value.references- list used as filter.- Returns:
- a filtered list of localized.
-