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.kuali.rice.krad.exception.DuplicateKeyException;
19
20 import java.util.LinkedHashMap;
21 import java.util.Map;
22
23
24
25
26 @Deprecated
27 public class StringMap extends LinkedHashMap<String, Object> {
28 private static final long serialVersionUID = 7364206011639131063L;
29
30
31
32
33
34
35
36 public void set(String key, Map<String, Object> value) {
37 setUnique(key, value);
38 }
39
40
41
42
43
44
45
46 public void set(String key, String value) {
47 setUnique(key, value);
48 }
49
50
51
52
53
54
55
56 private void setUnique(String key, Object value) {
57 if (value == null) {
58 throw new IllegalArgumentException("invalid (null) value");
59 }
60
61 if (containsKey(key)) {
62 throw new DuplicateKeyException("duplicate key '" + key + "'");
63 }
64
65 super.put(key, value);
66 }
67
68 @Override
69 public Object put(String key, Object value) {
70 throw new UnsupportedOperationException("direct calls to put not supported");
71 }
72
73 @Override
74 public void putAll(Map<? extends String, ? extends Object> m) {
75 throw new UnsupportedOperationException("direct calls to put not supported");
76 }
77 }