20: Make AlarmConfigurationParser return AlarmConfiguration

This commit is contained in:
2026-06-27 20:20:03 +02:00
parent 2d359f59e4
commit b0eb4e6d93
@@ -9,7 +9,7 @@ import java.util.*;
public final class AlarmConfigurationParser { public final class AlarmConfigurationParser {
public static List<PriceAlarmDefinition> parse(Path path) throws IOException { public static AlarmConfiguration parse(Path path) throws IOException {
List<String> lines = Files.readAllLines(path); List<String> lines = Files.readAllLines(path);
List<PriceAlarmDefinition> alarms = new ArrayList<>(); List<PriceAlarmDefinition> alarms = new ArrayList<>();
Map<String, String> constants = new LinkedHashMap<>(); Map<String, String> constants = new LinkedHashMap<>();
@@ -40,7 +40,7 @@ public final class AlarmConfigurationParser {
throw new IllegalArgumentException("No alarms found in " + path); throw new IllegalArgumentException("No alarms found in " + path);
} }
return List.copyOf(alarms); return new AlarmConfiguration(alarms, constants);
} }
static PriceAlarmDefinition parseLine(String line) { static PriceAlarmDefinition parseLine(String line) {