List<ExtensionFeature> features = new ArrayList<ExtensionFeature>();
for (Object extendedFeature : extendedFeatures) {
Map<String, Object> jsonFeature = getMap(extendedFeature);
ExtensionFeatureImpl feature = new ExtensionFeatureImpl();
feature.setId(getString(jsonFeature, JSON_FEATURE_ID));
feature.setUrl(getString(jsonFeature, JSON_FEATURE_URL));
feature.setCommonName(getString(jsonFeature, JSON_FEATURE_COMMON_NAME));
feature.setVersionLabel(getString(jsonFeature, JSON_FEATURE_VERSION_LABEL));
feature.setDescription(getString(jsonFeature, JSON_FEATURE_DESCRIPTION));
Map<String, Object> data = getMap(jsonFeature.get(JSON_FEATURE_DATA));
if (data != null) {
LinkedHashMap<String, String> dataMap = new LinkedHashMap<String, String>();
for (Map.Entry<String, Object> e : data.entrySet()) {
dataMap.put(e.getKey(), (e.getValue() == null ? null : e.getValue().toString()));
}
if (!dataMap.isEmpty()) {
feature.setFeatureData(dataMap);
}
}
convertExtension(jsonFeature, feature, FEATURE_KEYS);