Package com.hybris.cockpitng.i18n.impl
Class DefaultLocalizedValuesService
- java.lang.Object
-
- com.hybris.cockpitng.i18n.impl.DefaultLocalizedValuesService
-
- All Implemented Interfaces:
LocalizedValuesService
public class DefaultLocalizedValuesService extends java.lang.Object implements LocalizedValuesService
Default implementation of service for reading localized valuesLocalizedValuesService
-
-
Constructor Summary
Constructors Constructor Description DefaultLocalizedValuesService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CockpitLocaleServicegetCockpitLocaleService()java.lang.ObjectgetCurrentValue(java.util.Locale currentLocale, java.util.Map<java.util.Locale,java.lang.Object> values)Returns value from given map for given keyjava.lang.StringgetLanguageLabelKey(java.util.Locale locale)Builds language label key based on given localejava.util.LocalegetSelectedLocaleOrDefault(java.util.Map<java.util.Locale,java.lang.Object> values)Retrieves the first locale from the map if only one element is present Otherwise it returns default localevoidsetCockpitLocaleService(CockpitLocaleService cockpitLocaleService)
-
-
-
Method Detail
-
getLanguageLabelKey
public java.lang.String getLanguageLabelKey(java.util.Locale locale)
Description copied from interface:LocalizedValuesServiceBuilds language label key based on given locale- Specified by:
getLanguageLabelKeyin interfaceLocalizedValuesService- Parameters:
locale- an localized object to use- Returns:
- key of the label
-
getSelectedLocaleOrDefault
public java.util.Locale getSelectedLocaleOrDefault(java.util.Map<java.util.Locale,java.lang.Object> values)
Description copied from interface:LocalizedValuesServiceRetrieves the first locale from the map if only one element is present Otherwise it returns default locale- Specified by:
getSelectedLocaleOrDefaultin interfaceLocalizedValuesService- Parameters:
values- from which to retrieve locale- Returns:
- the first locale from the map or default locale
-
getCurrentValue
public java.lang.Object getCurrentValue(java.util.Locale currentLocale, java.util.Map<java.util.Locale,java.lang.Object> values)Description copied from interface:LocalizedValuesServiceReturns value from given map for given key- Specified by:
getCurrentValuein interfaceLocalizedValuesService- Parameters:
currentLocale- key based on which value is retrievedvalues- map from which value is retrieved- Returns:
- value from given map for given key
-
getCockpitLocaleService
public CockpitLocaleService getCockpitLocaleService()
-
setCockpitLocaleService
public void setCockpitLocaleService(CockpitLocaleService cockpitLocaleService)
-
-