1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.krad.datadictionary.exporter;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.krad.exception.DuplicateKeyException;
20
21 import java.util.LinkedHashMap;
22 import java.util.Map;
23
24
25
26
27
28
29
30 @Deprecated
31 public class StringMap extends LinkedHashMap<String, Object> {
32 private static final long serialVersionUID = 7364206011639131063L;
33
34
35
36
37
38
39
40 public void set(String key, Map<String, Object> value) {
41 setUnique(key, value);
42 }
43
44
45
46
47
48
49
50 public void set(String key, String value) {
51 setUnique(key, value);
52 }
53
54
55
56
57
58
59
60
61 private void setUnique(String key, Object value) {
62 if (value == null) {
63 throw new IllegalArgumentException("invalid (null) value");
64 }
65
66 if (containsKey(key)) {
67 throw new DuplicateKeyException("duplicate key '" + key + "'");
68 }
69
70 super.put(key, value);
71 }
72
73 @Override
74 public Object put(String key, Object value) {
75 throw new UnsupportedOperationException("direct calls to put not supported");
76 }
77
78 @Override
79 public void putAll(Map<? extends String, ? extends Object> m) {
80 throw new UnsupportedOperationException("direct calls to put not supported");
81 }
82 }