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 @XmlRootElement(name = "actionRequestPolicy")
26 @XmlType(name = "ActionRequestPolicyType")
27 @XmlEnum
28 public enum ActionRequestPolicy implements Coded {
29
30 @XmlEnumValue("F") FIRST("F", "FIRST"),
31 @XmlEnumValue("A") ALL("A", "ALL");
32
33 private final String code;
34 private final String label;
35
36 ActionRequestPolicy(String code, String label) {
37 this.code = code;
38 this.label = label;
39 }
40
41 @Override
42 public String getCode() {
43 return code;
44 }
45
46 public String getLabel() {
47 return label;
48 }
49
50 public static ActionRequestPolicy fromCode(String code) {
51 if (code == null) {
52 return null;
53 }
54 for (ActionRequestPolicy value : values()) {
55 if (value.code.equals(code)) {
56 return value;
57 }
58 }
59 throw new IllegalArgumentException("Failed to locate the ActionRequestPolicy with the given code: " + code);
60 }
61
62 }