package com.zy.core.utils.station.model;
|
|
import com.zy.core.model.command.StationCommand;
|
|
public final class RerouteExecutionResult {
|
private final boolean skipped;
|
private final String skipReason;
|
private final boolean dispatched;
|
private final StationCommand command;
|
private final int clearedCommandCount;
|
|
private RerouteExecutionResult(boolean skipped,
|
String skipReason,
|
boolean dispatched,
|
StationCommand command,
|
int clearedCommandCount) {
|
this.skipped = skipped;
|
this.skipReason = skipReason;
|
this.dispatched = dispatched;
|
this.command = command;
|
this.clearedCommandCount = clearedCommandCount;
|
}
|
|
public static RerouteExecutionResult skip(String reason) {
|
return new RerouteExecutionResult(true, reason, false, null, 0);
|
}
|
|
public static RerouteExecutionResult dispatched(StationCommand command,
|
int clearedCommandCount) {
|
return new RerouteExecutionResult(false, null, true, command, clearedCommandCount);
|
}
|
|
public boolean skipped() {
|
return skipped;
|
}
|
|
public String skipReason() {
|
return skipReason;
|
}
|
|
public boolean dispatched() {
|
return dispatched;
|
}
|
|
public StationCommand command() {
|
return command;
|
}
|
|
public int clearedCommandCount() {
|
return clearedCommandCount;
|
}
|
}
|