/** Creates a new multilingual extraction result. * @param defaultLocale the default (best fitting) locale of the result. * @param multilingualContentItems the content items for the different locales * @param fieldMappings special mappings to search fields with values extracted from the content */ public CmsExtractionResult( Locale defaultLocale, Map<Locale, LinkedHashMap<String, String>> multilingualContentItems, Map<String, String> fieldMappings) { m_defaultLocale = defaultLocale; m_contentItems = null != multilingualContentItems ? removeNullEntries(multilingualContentItems) : new HashMap<Locale, LinkedHashMap<String, String>>(1); // set the locales m_locales = new HashSet<Locale>(); for (Locale locale : m_contentItems.keySet()) { if (null != locale) { m_locales.add(locale); } } // ensure that a version for the default locale is present just to prevent null-checks if (null == m_contentItems.get(m_defaultLocale)) { m_contentItems.put(m_defaultLocale, new LinkedHashMap<String, String>()); } m_fieldMappings = null != fieldMappings ? fieldMappings : new HashMap<String, String>(); }