Address warnings and deprecations (#173)

This commit is contained in:
Michael Barry
2024-06-17 05:22:41 -04:00
committed by GitHub
parent 3c7e26da08
commit 4469a50ad9
16 changed files with 65 additions and 66 deletions

View File

@@ -604,16 +604,16 @@ public class Generate {
* "class") based on the "field mapping" defined in the layer schema definition.
*/
static MultiExpression<String> generateFieldMapping(JsonNode valuesNode) {
MultiExpression<String> mapping = MultiExpression.of(new ArrayList<>());
List<MultiExpression.Entry<String>> mappings = new ArrayList<>();
valuesNode.fields().forEachRemaining(entry -> {
String field = entry.getKey();
JsonNode node = entry.getValue();
Expression expression = or(parseFieldMappingExpression(node).toList()).simplify();
if (!expression.equals(or()) && !expression.equals(and())) {
mapping.expressions().add(MultiExpression.entry(field, expression));
mappings.add(MultiExpression.entry(field, expression));
}
});
return mapping;
return MultiExpression.of(mappings);
}
private static Stream<Expression> parseFieldMappingExpression(JsonNode node) {