1 |
|
package org.kuali.student.common.dto; |
2 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
3 |
|
public class DtoConstants { |
4 |
|
|
5 |
|
public final static String STATE_DRAFT = "Draft"; |
6 |
|
public final static String STATE_SUBMITTED = "Submitted"; |
7 |
|
public final static String STATE_WITHDRAWN = "Withdrawn"; |
8 |
|
public final static String STATE_APPROVED = "Approved"; |
9 |
|
public final static String STATE_NOT_APPROVED = "Not Approved"; |
10 |
|
public final static String STATE_ACTIVE = "Active"; |
11 |
|
public final static String STATE_INACTIVE = "Inactive"; |
12 |
|
public final static String STATE_SUPERSEDED = "Superseded"; |
13 |
|
public final static String STATE_SUSPENDED = "Suspended"; |
14 |
|
public final static String STATE_RETIRED = "Retired"; |
15 |
|
|
16 |
|
|
17 |
|
public static final String DTO_STATE = "DtoState"; |
18 |
|
public static final String DTO_NEXT_STATE = "DtoNextState"; |
19 |
|
|
20 |
|
|
|
|
| 0% |
Uncovered Elements: 43 (43) |
Complexity: 12 |
Complexity Density: 0.55 |
|
21 |
|
public enum DtoState { |
22 |
|
DRAFT, SUBMITTED, APPROVED, ACTIVE, INACTIVE, RETIRED, SUPERSEDED, SAVED, ENROUTE; |
23 |
|
|
|
|
| 0% |
Uncovered Elements: 5 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
24 |
0
|
public boolean equalsString(String state){... |
25 |
0
|
if (state != null){ |
26 |
0
|
return this.toString().equals(state.toUpperCase()); |
27 |
|
} |
28 |
|
|
29 |
0
|
return false; |
30 |
|
} |
31 |
|
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
@param |
39 |
|
@return |
40 |
|
|
|
|
| 0% |
Uncovered Elements: 29 (29) |
Complexity: 8 |
Complexity Density: 0.53 |
|
41 |
0
|
public static DtoState getNextState(String state){... |
42 |
|
|
43 |
0
|
if (DRAFT.equalsString(state)) { |
44 |
0
|
return SUBMITTED; |
45 |
0
|
} else if (SUBMITTED.equalsString(state)) { |
46 |
0
|
return APPROVED; |
47 |
0
|
} else if (APPROVED.equalsString(state)) { |
48 |
0
|
return ACTIVE; |
49 |
0
|
} else if (ACTIVE.equalsString(state)) { |
50 |
0
|
return INACTIVE; |
51 |
0
|
} else if (INACTIVE.equalsString(state)) { |
52 |
0
|
return RETIRED; |
53 |
|
|
54 |
|
|
55 |
0
|
} else if (SAVED.equalsString(state)) { |
56 |
0
|
return ENROUTE; |
57 |
0
|
} else if (ENROUTE.equalsString(state)) { |
58 |
0
|
return APPROVED; |
59 |
|
} |
60 |
|
|
61 |
|
|
62 |
0
|
return null; |
63 |
|
} |
64 |
|
|
|
|
| 0% |
Uncovered Elements: 6 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
65 |
0
|
public static String getNextStateAsString(String state){... |
66 |
0
|
DtoState dtoState = getNextState(state); |
67 |
0
|
if (dtoState == null){ |
68 |
0
|
return null; |
69 |
|
} else { |
70 |
0
|
return dtoState.toString(); |
71 |
|
} |
72 |
|
} |
73 |
|
} |
74 |
|
} |