Junjie
1 天以前 1da4047a0a011bdbab1e6ae1135e4abb1bcebad2
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
package com.zy.core.utils.station.model;
 
public final class RerouteDecision {
    private final boolean skip;
    private final String skipReason;
    private final Integer targetStationId;
    private final OutOrderDispatchDecision dispatchDecision;
 
    private RerouteDecision(boolean skip,
                            String skipReason,
                            Integer targetStationId,
                            OutOrderDispatchDecision dispatchDecision) {
        this.skip = skip;
        this.skipReason = skipReason;
        this.targetStationId = targetStationId;
        this.dispatchDecision = dispatchDecision;
    }
 
    public static RerouteDecision skip(String reason) {
        return new RerouteDecision(true, reason, null, null);
    }
 
    public static RerouteDecision proceed(Integer targetStationId) {
        return new RerouteDecision(false, null, targetStationId, null);
    }
 
    public static RerouteDecision proceed(Integer targetStationId,
                                          OutOrderDispatchDecision dispatchDecision) {
        return new RerouteDecision(false, null, targetStationId, dispatchDecision);
    }
 
    public boolean skip() {
        return skip;
    }
 
    public String skipReason() {
        return skipReason;
    }
 
    public Integer targetStationId() {
        return targetStationId;
    }
 
    public OutOrderDispatchDecision dispatchDecision() {
        return dispatchDecision;
    }
}