Clover Coverage Report - KS Contract Documentation Generator 0.0.1-SNAPSHOT
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
../../../../../../../img/srcFileCovDistChart0.png 0% of files have more coverage
22   75   12   7.33
18   50   0.55   1.5
3     4  
2    
 
  DtoConstants       Line # 4 0 - 0 0 - -1.0
  DtoConstants.DtoState       Line # 22 22 0% 12 43 0% 0.0
 
No Tests
 
1    package org.kuali.student.contract.model.test.source;
2   
3   
 
4    public class DtoConstants {
5   
6    public final static String STATE_DRAFT = "Draft";
7    public final static String STATE_SUBMITTED = "Submitted";
8    public final static String STATE_WITHDRAWN = "Withdrawn";
9    public final static String STATE_APPROVED = "Approved";
10    public final static String STATE_NOT_APPROVED = "Not Approved";
11    public final static String STATE_ACTIVE = "Active";
12    public final static String STATE_INACTIVE = "Inactive";
13    public final static String STATE_SUPERSEDED = "Superseded";
14    public final static String STATE_SUSPENDED = "Suspended";
15    public final static String STATE_RETIRED = "Retired";
16   
17   
18    public static final String DTO_STATE = "DtoState";
19    public static final String DTO_NEXT_STATE = "DtoNextState";
20   
21    //FIXME: Need to split out proposal states (ie. workflow states) versus dto states
 
22    public enum DtoState {
23    DRAFT, SUBMITTED, APPROVED, ACTIVE, INACTIVE, RETIRED, SUPERSEDED, SAVED, ENROUTE;
24   
 
25  0 toggle public boolean equalsString(String state){
26  0 if (state != null){
27  0 return this.toString().equals(state.toUpperCase());
28    }
29   
30  0 return false;
31    }
32   
33    /**
34    * This is used to determine the next state.
35    *
36    * TODO: Ideally this method should not be hardcoded here. Also determining next state may
37    * be a more complicated and not just be a simple sequence.
38    *
39    * @param state
40    * @return the next state
41    */
 
42  0 toggle public static DtoState getNextState(String state){
43    // Element States
44  0 if (DRAFT.equalsString(state)) {
45  0 return SUBMITTED;
46  0 } else if (SUBMITTED.equalsString(state)) {
47  0 return APPROVED;
48  0 } else if (APPROVED.equalsString(state)) {
49  0 return ACTIVE;
50  0 } else if (ACTIVE.equalsString(state)) {
51  0 return INACTIVE;
52  0 } else if (INACTIVE.equalsString(state)) {
53  0 return RETIRED;
54   
55    // Proposal States
56  0 } else if (SAVED.equalsString(state)) {
57  0 return ENROUTE;
58  0 } else if (ENROUTE.equalsString(state)) {
59  0 return APPROVED;
60    }
61   
62   
63  0 return null;
64    }
65   
 
66  0 toggle public static String getNextStateAsString(String state){
67  0 DtoState dtoState = getNextState(state);
68  0 if (dtoState == null){
69  0 return null;
70    } else {
71  0 return dtoState.toString();
72    }
73    }
74    }
75    }