Skip to content

Commit

Permalink
changed featureList to a map of lists
Browse files Browse the repository at this point in the history
  • Loading branch information
ChemMitch committed Aug 8, 2024
1 parent 47b7287 commit 5095c55
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2016,12 +2016,14 @@ private void appendFeatureStuff(Chemical chemical, ObjectNode topLevelNode ) thr
log.trace("in appendFeatureStuff");
ObjectMapper mapper = new ObjectMapper();
List<Map<String, String>> featureList = FeatureUtils.calculateFeatures(chemical);
ObjectNode allFeatures = mapper.createObjectNode();
ArrayNode featureArrayNode = mapper.createArrayNode();
featureList.forEach(features ->{
ObjectNode oneSet = mapper.createObjectNode();
features.entrySet().forEach(f-> oneSet.put(f.getKey(), f.getValue()));
featureArrayNode.add(oneSet);
});
topLevelNode.put("featureList", featureArrayNode);
allFeatures.put("nitrosamineAnalysisFeatures", featureArrayNode);
topLevelNode.put("featureList", allFeatures);
}
}

0 comments on commit 5095c55

Please sign in to comment.