-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRequest.java
More file actions
29 lines (24 loc) · 788 Bytes
/
Copy pathRequest.java
File metadata and controls
29 lines (24 loc) · 788 Bytes
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
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
public class Request implements Serializable {
private static final long serialVersionUID = 1L;
public enum RequestType {
AUTHENTICATE,
GET_BALANCE,
GET_PRODUCTS,
PROCESS_PURCHASE,
GET_TRANSACTION_HISTORY,
HEARTBEAT
}
private RequestType type;
private Map<String, Object> data;
public Request(RequestType type) {
this.type = type;
this.data = new HashMap<>();
}
public RequestType getType() { return type; }
public void setData(String key, Object value) { data.put(key, value); }
public Object getData(String key) { return data.get(key); }
public Map<String, Object> getAllData() { return data; }
}