View Javadoc

1   package org.kuali.rice.kim.api.identity.personal;
2   
3   import org.kuali.rice.core.api.mo.common.Coded;
4   
5   import javax.xml.bind.annotation.XmlEnum;
6   import javax.xml.bind.annotation.XmlEnumValue;
7   import javax.xml.bind.annotation.XmlRootElement;
8   import javax.xml.bind.annotation.XmlType;
9   
10  /**
11   * A DisabilityConditionStatusCode is an enum that represents valid type indicating a disability condition status.
12   */
13  @XmlRootElement(name = "disabilityConditionStatusCodeType")
14  @XmlType(name = "disabilityConditionStatusCodeTypeType")
15  @XmlEnum
16  public enum DisabilityConditionStatusCode implements Coded {
17  
18      /**
19       * Condition type corresponding to Permanent disabilities
20       */
21      @XmlEnumValue("P") PERMANENT("P"),
22  
23      /**
24       * Condition type corresponding to Temporary disabilities
25       */
26      @XmlEnumValue("T") TEMPORARY("T");
27  
28      public final String code;
29  
30      private DisabilityConditionStatusCode(String code) {
31          this.code = code;
32      }
33  
34      @Override
35      public String getCode() {
36          return this.code;
37      }
38  
39      public static DisabilityConditionStatusCode fromCode(String code) {
40          if (code == null) {
41              return null;
42          }
43          for (DisabilityConditionStatusCode codeType : values()) {
44              if (codeType.code.equals(code)) {
45                  return codeType;
46              }
47          }
48          throw new IllegalArgumentException("Failed to locate the DisabilityConditionStatusCode with the given code: " + code);
49      }
50  
51  }
52