View Javadoc

1   package uk.ac.ebi.intenz.domain.constants;
2   
3   import uk.ac.ebi.intenz.domain.enzyme.EnzymeCommissionNumber.Type;
4   
5   /**
6    * Enzyme entry status.
7    * @author rafalcan
8    *
9    */
10  public enum Status {
11  
12  	/**
13  	 * This preliminary status should only be applied to enzymes with
14  	 * {@link Type#PRELIMINARY preliminary} EC type and vice-versa.
15  	 */
16  	PRELIMINARY("PM"),
17  	SUGGESTED("SU"),
18  	PROPOSED("PR"),
19  	APPROVED("OK");
20  	
21  	private String code;
22  	
23  	private Status(String code){ this.code = code; }
24  	
25  	public String getCode(){ return code; }
26  	
27  	public static Status fromCode(String code){
28  		for (Status status : Status.values()){
29  			if (status.code.equals(code)) return status;
30  		}
31  		return null;
32  	}
33  	
34  }