- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJSONSyncHashMapPersistence.java
More file actions
Latest commit
34 lines (27 loc) · 762 Bytes
/
Copy pathJSONSyncHashMapPersistence.java
File metadata and controls
34 lines (27 loc) · 762 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
30
31
32
33
34
packagecom.jsonsync;
importcom.jsonsync.JSONSyncPersistenceInterface;
importjava.util.HashMap;
importjava.util.Map;
/**
*
* @author Arnaud CAVAILHEZ
*/
classJSONSyncHashMapPersistenceimplementsJSONSyncPersistenceInterface {
privateHashMap<String, String> hash;
publicStringtoString() {
Stringout = "";
for (Map.Entry<String, String> entry : hash.entrySet()) {
out += entry.getKey() + "===" + entry.getValue() + "\n";
}
returnout;
}
publicJSONSyncHashMapPersistence() {
hash = newHashMap<String, String>();
}
publicStringget(Stringkey) {
returnhash.get(key);
}
publicvoidput(Stringkey, Stringvalue) {
hash.put(key, value);
}
}