1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.api.action; |
17 | |
|
18 | |
import javax.xml.bind.annotation.XmlEnum; |
19 | |
import javax.xml.bind.annotation.XmlEnumValue; |
20 | |
import javax.xml.bind.annotation.XmlRootElement; |
21 | |
import javax.xml.bind.annotation.XmlType; |
22 | |
|
23 | |
import org.kuali.rice.core.api.mo.common.Coded; |
24 | |
|
25 | 0 | @XmlRootElement(name = "actionRequestStatus") |
26 | |
@XmlType(name = "ActionRequestStatusType") |
27 | |
@XmlEnum |
28 | |
public enum ActionRequestStatus implements Coded { |
29 | |
|
30 | |
|
31 | |
|
32 | |
|
33 | 0 | @XmlEnumValue("D") DONE("D", "DONE"), |
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | 0 | @XmlEnumValue("A") ACTIVATED("A", "ACTIVATED"), |
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | 0 | @XmlEnumValue("I") INITIALIZED("I", "INITIALIZED"); |
44 | |
|
45 | |
private final String code; |
46 | |
private final String label; |
47 | |
|
48 | 0 | ActionRequestStatus(String code, String label) { |
49 | 0 | this.code = code; |
50 | 0 | this.label = label; |
51 | 0 | } |
52 | |
|
53 | |
@Override |
54 | |
public String getCode() { |
55 | 0 | return code; |
56 | |
} |
57 | |
|
58 | |
public String getLabel() { |
59 | 0 | return label; |
60 | |
} |
61 | |
|
62 | |
public static ActionRequestStatus fromCode(String code) { |
63 | 0 | if (code == null) { |
64 | 0 | return null; |
65 | |
} |
66 | 0 | for (ActionRequestStatus request : values()) { |
67 | 0 | if (request.code.equals(code)) { |
68 | 0 | return request; |
69 | |
} |
70 | |
} |
71 | 0 | throw new IllegalArgumentException("Failed to locate the ActionRequestStatus with the given code: " + code); |
72 | |
} |
73 | |
|
74 | |
} |