Coverage Report - org.kuali.student.lum.program.client.ProgramStatus
 
Classes in this File Line Coverage Branch Coverage Complexity
ProgramStatus
0%
0/17
0%
0/4
1.6
 
 1  
 package org.kuali.student.lum.program.client;
 2  
 
 3  
 import org.kuali.student.common.ui.client.mvc.DataModel;
 4  
 
 5  
 /**
 6  
  * @author Igor
 7  
  */
 8  0
 public enum ProgramStatus {
 9  0
     SUPERSEDED(ProgramMsgConstants.STATUS_SUPERSEDED, null),
 10  0
     ACTIVE(ProgramMsgConstants.STATUS_ACTIVE, SUPERSEDED),
 11  0
     APPROVED(ProgramMsgConstants.STATUS_APPROVED, ACTIVE),
 12  0
     DRAFT(ProgramMsgConstants.STATUS_DRAFT, APPROVED),
 13  0
     NOTAPPROVED(ProgramMsgConstants.STATUS_NOTAPPROVED, null);
 14  
 
 15  
     private final String value;
 16  
 
 17  
     private final ProgramStatus nextStatus;
 18  
 
 19  0
     ProgramStatus(String value, ProgramStatus nextStatus) {
 20  0
         this.value = value;
 21  0
         this.nextStatus = nextStatus;
 22  0
     }
 23  
 
 24  
     public String getValue() {
 25  0
         return value;
 26  
     }
 27  
 
 28  
     public ProgramStatus getNextStatus() {
 29  0
         return nextStatus;
 30  
     }
 31  
 
 32  
     public static ProgramStatus of(String value) {
 33  0
         for (ProgramStatus status : values()) {
 34  0
             if (status.getValue().equalsIgnoreCase(value)) {
 35  0
                 return status;
 36  
             }
 37  
         }
 38  0
         return null;
 39  
     }
 40  
 
 41  
     public static ProgramStatus of(DataModel programModel) {
 42  0
         return of(ProgramUtils.getProgramState(programModel));
 43  
     }
 44  
 }