1 package net.sf.mbus4j.dataframes.datablocks.vif;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 public enum ObjectAction {
36
37 WRITE(0x00, "write(replace)"),
38 ADD_VALUE(0x01, "add value"),
39 SUBTRACT_VALUE(0x02, "subtract value"),
40 OR(0x03, "or"),
41 AND(0x04, "and"),
42 XOR(0x05, "xor"),
43 AND_NOT(0x06, "and not"),
44 CLEAR(0x07, "clear"),
45 ADD_ENTRY(0x08, "add entry"),
46 DELETE_ENTRY(0x09, "delete entry"),
47 RESERVED_0X0A(0x0A, "Reserved 0x0A"),
48 FREEZE_DATA(0x0B, "freeze data"),
49 ADD_TO_READOUT_LIST(0x0C, "add to readout list"),
50 DELETE_FROM_READOUT_LIST(0x0D, "delete from readout list");
51
52 public static ObjectAction valueOf(int id) {
53 for (ObjectAction oa : ObjectAction.values()) {
54 if (oa.id == id) {
55 return oa;
56 }
57 }
58 return null;
59 }
60 public final int id;
61 private final String label;
62
63 private ObjectAction(int id, String label) {
64 this.id = id;
65 this.label = label;
66 }
67
68 @Override
69 public String toString() {
70 return label;
71 }
72
73 public String getLabel() {
74 return label;
75 }
76
77 public static ObjectAction fromLabel(String label) {
78 for (ObjectAction value : values()) {
79 if (value.label.equals(label)) {
80 return value;
81 }
82 }
83 return valueOf(label);
84 }
85 }