1 |
|
package org.kuali.student.core.dto; |
2 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 0 |
Complexity Density: - |
|
3 |
|
public class DtoConstants { |
4 |
|
|
5 |
|
public static final String DTO_STATE = "DtoState"; |
6 |
|
public static final String DTO_NEXT_STATE = "DtoNextState"; |
7 |
|
|
8 |
|
|
|
|
| 67.4% |
Uncovered Elements: 14 (43) |
Complexity: 12 |
Complexity Density: 0.55 |
|
9 |
|
public enum DtoState { |
10 |
|
DRAFT, SUBMITTED, APPROVED, ACTIVE, INACTIVE, RETIRED, SUPERSEDED, SAVED, ENROUTE; |
11 |
|
|
|
|
| 60% |
Uncovered Elements: 2 (5) |
Complexity: 2 |
Complexity Density: 0.67 |
|
12 |
14
|
public boolean equalsString(String state){... |
13 |
14
|
if (state != null){ |
14 |
14
|
return this.toString().equals(state.toUpperCase()); |
15 |
|
} |
16 |
|
|
17 |
0
|
return false; |
18 |
|
} |
19 |
|
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
|
@param |
27 |
|
@return |
28 |
|
|
|
|
| 58.6% |
Uncovered Elements: 12 (29) |
Complexity: 8 |
Complexity Density: 0.53 |
|
29 |
8
|
public static DtoState getNextState(String state){... |
30 |
|
|
31 |
8
|
if (DRAFT.equalsString(state)) { |
32 |
7
|
return SUBMITTED; |
33 |
1
|
} else if (SUBMITTED.equalsString(state)) { |
34 |
0
|
return APPROVED; |
35 |
1
|
} else if (APPROVED.equalsString(state)) { |
36 |
0
|
return ACTIVE; |
37 |
1
|
} else if (ACTIVE.equalsString(state)) { |
38 |
0
|
return INACTIVE; |
39 |
1
|
} else if (INACTIVE.equalsString(state)) { |
40 |
0
|
return RETIRED; |
41 |
|
|
42 |
|
|
43 |
1
|
} else if (SAVED.equalsString(state)) { |
44 |
0
|
return ENROUTE; |
45 |
1
|
} else if (ENROUTE.equalsString(state)) { |
46 |
0
|
return APPROVED; |
47 |
|
} |
48 |
|
|
49 |
|
|
50 |
1
|
return null; |
51 |
|
} |
52 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
53 |
8
|
public static String getNextStateAsString(String state){... |
54 |
8
|
DtoState dtoState = getNextState(state); |
55 |
8
|
if (dtoState == null){ |
56 |
1
|
return null; |
57 |
|
} else { |
58 |
7
|
return dtoState.toString(); |
59 |
|
} |
60 |
|
} |
61 |
|
} |
62 |
|
} |