mirror of
https://github.com/cfpwastaken/planetiler-openmaptiles.git
synced 2026-02-04 12:31:10 +00:00
Data type support for Expression / MultiExpression (#190)
This commit is contained in:
committed by
GitHub
parent
3500ee0240
commit
b790ad8cd6
@@ -431,7 +431,7 @@ public class Generate {
|
||||
/** Imposm3 "mapping" to filter OSM elements that should appear in this "table". */
|
||||
public static final Expression MAPPING = %s;
|
||||
""".formatted(
|
||||
mappingExpression
|
||||
mappingExpression.generateJavaCode()
|
||||
);
|
||||
String tableName = "osm_" + key;
|
||||
String className = lowerUnderscoreToUpperCamel(tableName);
|
||||
@@ -652,7 +652,7 @@ public class Generate {
|
||||
/** Returns java code that will recreate an {@link MultiExpression} identical to {@code mapping}. */
|
||||
private static String generateJavaCode(MultiExpression<String> mapping) {
|
||||
return "MultiExpression.of(List.of(" + mapping.expressions().stream()
|
||||
.map(s -> "MultiExpression.entry(%s, %s)".formatted(Format.quote(s.result()), s.expression()))
|
||||
.map(s -> "MultiExpression.entry(%s, %s)".formatted(Format.quote(s.result()), s.expression().generateJavaCode()))
|
||||
.collect(joining(", ")) + "))";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user