Class LocalizedAttributesProcessor

java.lang.Object
de.hybris.platform.servicelayer.internal.converter.impl.LocalizedAttributesProcessor

public final class LocalizedAttributesProcessor extends Object
Extracted internal processor to marge localized attributes for backed by db locale and not backed by db locale into destination map.

There is used a rule that: # more specific locale override the more general # if the locales are of same 'precision' the natural order is used.

  • Constructor Details

    • LocalizedAttributesProcessor

      public LocalizedAttributesProcessor(I18NService i18NService)
  • Method Details

    • processQualifiersWithValues

      public Map<Locale,Map<String,Object>> processQualifiersWithValues(Map<Locale,Map<String,Object>> additionalLocalizedValuesMap)
    • processQualifiers

      public Map<Locale,Set<String>> processQualifiers(Map<Locale,Set<String>> dirtyLocalizedAttributes)
      Filters out qualifier attribute leaving the most specific: Example :
       Given the changes
       new Locale("de") : foo , bar, baz
       new Locale("de","au") : bar , bax
       new Locale("de","au","inn") : baz , bax
      
       The result will be :
      
       new Locale("de") : foo
       new Locale("de","au") : bar
       new Locale("de","au","inn") : baz, bax
      
       
      Parameters:
      dirtyLocalizedAttributes -
      Returns:
      filtered out qualifier attribute.
    • getLocaleOrder

      public Map<Locale,Set<Locale>> getLocaleOrder(Collection<Locale> locales)