Command.java
1.42 KB
1
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package com.irrigation.icl.cache;
import lombok.Data;
import java.io.Serializable;
/**
* Command
*/
@Data
public class Command implements Serializable {
private static final long serialVersionUID = 7126530485423286910L;
// 设置本地缓存
public final static byte OPT_SET = 0x01;
// 删除本地缓存Key
public final static byte OPT_DEL = 0x02;
// 删除本地缓存
public final static byte OPT_REM = 0x03;
public byte oper;
public String name;
public String key;
public String src;
public Command() {
}
public Command(String src, byte oper, String name, String key) {
this.src = src;
this.oper = oper;
this.name = name;
this.key = key;
}
/**
* 更新本地缓存
*
* @param cacheName
* @param key
* @return
*/
public static Command set(String src, String cacheName, String key) {
return new Command(src, OPT_SET, cacheName, key);
}
/**
* 删除本地缓存Key
*
* @param cacheName
* @param key
* @return
*/
public static Command del(String src, String cacheName, String key) {
return new Command(src, OPT_DEL, cacheName, key);
}
/**
* 删除本地缓存
*
* @param cacheName
* @return
*/
public static Command rem(String src, String cacheName) {
return new Command(src, OPT_REM, cacheName, null);
}
}