Skip to content

Commit 76271a5

Browse files
committed
add OHOperationType enum
1 parent ca63d43 commit 76271a5

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
package com.alipay.oceanbase.rpc.protocol.payload.impl.execute;
2+
3+
import java.util.*;
4+
5+
public enum OHOperationType {
6+
PUT(0),
7+
PUT_LIST(1),
8+
DELETE(2),
9+
DELETE_LIST(3),
10+
GET(4),
11+
GET_LIST(5),
12+
EXISTS(6),
13+
EXISTS_LIST(7),
14+
BATCH(8),
15+
BATCH_CALLBACK(9),
16+
SCAN(10),
17+
CHECK_AND_PUT(11),
18+
CHECK_AND_DELETE(12),
19+
CHECK_AND_MUTATE(13),
20+
APPEND(14),
21+
INCREMENT(15),
22+
INCREMENT_COLUMN_VALUE(16),
23+
MUTATE_ROW(17);
24+
25+
private final int value;
26+
private static final Map<Integer, OHOperationType> map = new HashMap<Integer, OHOperationType>();
27+
28+
static {
29+
for (OHOperationType type : OHOperationType.values()) {
30+
map.put(type.value, type);
31+
}
32+
}
33+
34+
OHOperationType(int value) {
35+
this.value = value;
36+
}
37+
38+
public static OHOperationType valueOf(int value) {
39+
return map.get(value);
40+
}
41+
42+
public int getValue() {
43+
return value;
44+
}
45+
46+
public byte getByteValue() {
47+
return (byte) value;
48+
}
49+
}

0 commit comments

Comments
 (0)