Expose caresAboutLayer() and new ForwardingProfile(config) ... (#968)

pull/972/head
Peter Hanecak 2024-08-01 11:24:56 +02:00 zatwierdzone przez GitHub
rodzic 2b65295559
commit 797e250f23
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -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);
}
@ -80,7 +84,7 @@ public abstract class ForwardingProfile implements Profile {
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());
}