Commit 617c2785 authored by Jakob Schöttl's avatar Jakob Schöttl
Browse files

Allow log event processor only for normal compartments

parent 16e0e8bf
......@@ -74,6 +74,12 @@ public class LogEventProcessor extends DataProcessor<IdDataKey, LogEventEntry> {
private Set<Seat> getSeatsOfCompartment() {
final Compartment compartment = trainModel.getCompartment(attributes.getCompartmentIndex());
if (compartment.isHalfCompartment())
throw new IllegalArgumentException(
"The log event processors's attribute compartmentIndex denotes a half-compartment."
+ "The processor cannot be used for half-compartments.");
// Otherwise, the resulting files are not comparable with the collected data.
final Set<Seat> result = new HashSet<>();
for (SeatGroup sg : compartment.getSeatGroups()) {
result.addAll(sg.getSeats());
......
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