#
Junjie
1 天以前 aa710969e00e9d7e56a276066a239f74d5c49310
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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;
    }
}