Skip to content

Commit ac5033a

Browse files
committed
Create a ParameterMap Utils
1 parent be9d7c3 commit ac5033a

File tree

1 file changed

+86
-0
lines changed

1 file changed

+86
-0
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
package cv.mikusher.utils;
2+
3+
import java.util.Collection;
4+
import java.util.HashMap;
5+
import java.util.Map;
6+
import java.util.Set;
7+
8+
public class ParameterMap implements Map<String, String> {
9+
10+
private Map<String, String> map = new HashMap<String, String>();
11+
12+
@Override
13+
public void clear() {
14+
map.clear();
15+
}
16+
17+
@Override
18+
public boolean containsKey(Object key) {
19+
return map.containsKey(key);
20+
}
21+
22+
@Override
23+
public boolean containsValue(Object value) {
24+
return map.containsValue(value);
25+
}
26+
27+
@Override
28+
public Set<java.util.Map.Entry<String, String>> entrySet() {
29+
return map.entrySet();
30+
}
31+
32+
@Override
33+
public String get(Object key) {
34+
return map.get(key);
35+
}
36+
37+
@Override
38+
public boolean isEmpty() {
39+
return map.isEmpty();
40+
}
41+
42+
@Override
43+
public Set<String> keySet() {
44+
return map.keySet();
45+
}
46+
47+
@Override
48+
public String put(String key, String value) {
49+
return map.put(key, value);
50+
}
51+
52+
@Override
53+
public void putAll(Map<? extends String, ? extends String> arg) {
54+
map.putAll(arg);
55+
}
56+
57+
@Override
58+
public String remove(Object key) {
59+
return map.remove(key);
60+
}
61+
62+
@Override
63+
public int size() {
64+
return map.size();
65+
}
66+
67+
@Override
68+
public Collection<String> values() {
69+
return map.values();
70+
}
71+
72+
/**
73+
* Convenience method returns this class so multiple calls can be chained.
74+
*
75+
* @param name
76+
* @param value
77+
* @return This map
78+
*/
79+
public ParameterMap add(String name, String value) {
80+
map.put(name, value);
81+
return this;
82+
}
83+
84+
//todo: convert to Json Object
85+
86+
}

0 commit comments

Comments
 (0)