P15GEN2\59518
2025-10-10 9f6890646993d16260d4201d613c092132856127
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
package foundation.state;
 
import foundation.workflow.IState;
import foundation.data.entity.Entity;
import foundation.json.IJSONProvider;
import foundation.json.IJSONWriter;
 
public class State implements IState, IJSONProvider {
 
    private String id;
    private String code;
    private String categoryCode;
    private String name;
    private boolean inFreedom;
    private boolean step;
    private String stepName;
    private int indexNo;
    
    public State() {
        
    }
    
    public State(String code, String name) {
        this.code = code;
        this.name = name;
    }
    
    public void load(Entity entity) throws Exception {
        id = entity.getString("id");
        code = entity.getString("code");
        categoryCode = entity.getString("category_code");
        name = entity.getString("name");    
        inFreedom = entity.getBoolean("is_in_freedom", true);
        step = entity.getBoolean("is_step", false);
        stepName = entity.getString("step_name");
        indexNo =  entity.getInt("index_no");
    }
 
    public static State stateCopy(State source) {
        State target = new State();
        target.setId(source.getId());
        target.setCode(source.getCode());
        target.setCategoryCode(source.getCategoryCode());
        target.setName(source.getName());
        target.setStep(source.isStep());
        target.setStepName(source.getStepName());
        target.setIndexNo(source.getIndexNo());
        return target;
    }
 
    public String getId() {
        return id;
    }
 
    public void setId(String id) {
        this.id = id;
    }
 
    public String getCode() {
        return code;
    }
 
    public void setCode(String code) {
        this.code = code;
    }
 
    public String getCategoryCode() {
        return categoryCode;
    }
 
    public void setCategoryCode(String categoryCode) {
        this.categoryCode = categoryCode;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public boolean isInFreedom() {
        return inFreedom;
    }
 
    public void setInFreedom(boolean inFreedom) {
        this.inFreedom = inFreedom;
    }
 
    public boolean isStep() {
        return step;
    }
 
    public void setStep(boolean step) {
        this.step = step;
    }
 
    public String getStepName() {
        return stepName;
    }
 
    public void setStepName(String stepName) {
        this.stepName = stepName;
    }
 
    public int getIndexNo() {
        return indexNo;
    }
 
    public void setIndexNo(int indexNo) {
        this.indexNo = indexNo;
    }
 
    @Override
    public void writeJSON(IJSONWriter writer) {
        writer.beginObject();
 
        writer.write("id", id);
        writer.write("code", code);
        writer.write("categoryCode", categoryCode);
        writer.write("name", name);
        writer.write("inFreedom", inFreedom);
        writer.write("step", step);
        writer.write("stepName", stepName);
        writer.write("indexNo", indexNo);
        
        writer.endObject();
    }
 
}