01: package org.emforge.xfer;
02:
03: /**
04: * Transfer Object for priority
05: */
06: public enum PriorityTO {
07:
08: ASAP(1, "ASAP"), HIGH(2, "High"), NORMAL(3, "Normal"), LOW(4, "Low"), LOWEST(
09: 5, "Lowest");
10:
11: private Integer value;
12: private String name;
13:
14: /**
15: * @param value
16: * @param name
17: */
18: private PriorityTO(Integer value, String name) {
19:
20: this .value = value;
21: this .name = name;
22: }
23:
24: /**
25: * @return
26: */
27: public Integer getValue() {
28:
29: return value;
30: }
31:
32: /**
33: * @param i_value
34: */
35: public void setValue(Integer i_value) {
36:
37: value = i_value;
38: }
39:
40: /**
41: * @return
42: */
43: public String getName() {
44:
45: return name;
46: }
47:
48: /**
49: * @param i_name
50: */
51: public void setName(String i_name) {
52:
53: name = i_name;
54: }
55:
56: /**
57: * Returns Priority by value
58: */
59: public static PriorityTO getPriority(int value) {
60:
61: for (PriorityTO priority : PriorityTO.values()) {
62: if (priority.getValue().equals(value)) {
63: return priority;
64: }
65: }
66:
67: return null;
68: }
69: }
|