Skip to content

Commit

Permalink
Expose caresAboutLayer() and new ForwardingProfile(config) ... (#968)
Browse files Browse the repository at this point in the history
  • Loading branch information
phanecak-maptiler authored Aug 1, 2024
1 parent 2b65295 commit 797e250
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,13 @@ public abstract class ForwardingProfile implements Profile {
@SuppressWarnings("java:S3077")
private volatile MultiExpression.Index<FeatureProcessor> indexedSourceElementProcessors = null;

protected ForwardingProfile(PlanetilerConfig config, Handler... handlers) {
protected ForwardingProfile(PlanetilerConfig config) {
onlyLayers = config.arguments().getList("only_layers", "Include only certain layers", List.of());
excludeLayers = config.arguments().getList("exclude_layers", "Exclude certain layers", List.of());
}

protected ForwardingProfile(PlanetilerConfig config, Handler... handlers) {
this(config);
for (var handler : handlers) {
registerHandler(handler);
}
Expand All @@ -80,7 +84,7 @@ private boolean caresAboutLayer(String layer) {
return (onlyLayers.isEmpty() || onlyLayers.contains(layer)) && !excludeLayers.contains(layer);
}

private boolean caresAboutLayer(Object obj) {
public boolean caresAboutLayer(Object obj) {
return !(obj instanceof HandlerForLayer l) || caresAboutLayer(l.name());
}

Expand Down

0 comments on commit 797e250

Please sign in to comment.