Commit d06f29ab authored by Riegel's avatar Riegel
Browse files

Converted record back to class. Ref #69

parent 9ba8a6ef
...@@ -317,7 +317,7 @@ public class Checker { ...@@ -317,7 +317,7 @@ public class Checker {
if (excludeFilters != null) { if (excludeFilters != null) {
for (Filter f : excludeFilters) { for (Filter f : excludeFilters) {
if (f instanceof TypeFilter tf) { if (f instanceof TypeFilter tf) {
FeatureType type = tf.type(); FeatureType type = tf.getType();
TopLevelFeatureType tlft = mapToTopLevelFeatureType(type); TopLevelFeatureType tlft = mapToTopLevelFeatureType(type);
if (tlft == null) { if (tlft == null) {
continue; continue;
...@@ -336,7 +336,7 @@ public class Checker { ...@@ -336,7 +336,7 @@ public class Checker {
} else { } else {
for (Filter f : includeFilters) { for (Filter f : includeFilters) {
if (f instanceof TypeFilter tf) { if (f instanceof TypeFilter tf) {
FeatureType type = tf.type(); FeatureType type = tf.getType();
TopLevelFeatureType tlft = mapToTopLevelFeatureType(type); TopLevelFeatureType tlft = mapToTopLevelFeatureType(type);
if (tlft == null) { if (tlft == null) {
continue; continue;
......
...@@ -21,17 +21,28 @@ package de.hft.stuttgart.citydoctor2.check; ...@@ -21,17 +21,28 @@ package de.hft.stuttgart.citydoctor2.check;
import de.hft.stuttgart.citydoctor2.datastructure.CityObject; import de.hft.stuttgart.citydoctor2.datastructure.CityObject;
import de.hft.stuttgart.citydoctor2.datastructure.FeatureType; import de.hft.stuttgart.citydoctor2.datastructure.FeatureType;
/** /**
* Filters the feature type of features * Filters the feature type of features
* *
* @author Matthias Betz * @author Matthias Betz
*/ */
public record TypeFilter(FeatureType type) implements Filter { public class TypeFilter implements Filter {
private final FeatureType type;
public TypeFilter(FeatureType type) {
this.type = type;
}
@Override @Override
public boolean matches(CityObject co) { public boolean matches(CityObject co) {
return co.getFeatureType() == type; return co.getFeatureType() == type;
} }
public FeatureType getType() {
return type;
}
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment