1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.collections4.multimap;
18
19 import java.io.Serializable;
20 import java.util.Collection;
21 import java.util.Map;
22 import java.util.Map.Entry;
23 import java.util.Objects;
24 import java.util.Set;
25
26 import org.apache.commons.collections4.MapIterator;
27 import org.apache.commons.collections4.MultiSet;
28 import org.apache.commons.collections4.MultiValuedMap;
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43 public abstract class AbstractMultiValuedMapDecorator<K, V>
44 implements MultiValuedMap<K, V>, Serializable {
45
46
47 private static final long serialVersionUID = 20150612L;
48
49
50 private final MultiValuedMap<K, V> map;
51
52
53
54
55
56
57
58 protected AbstractMultiValuedMapDecorator(final MultiValuedMap<K, V> map) {
59 this.map = Objects.requireNonNull(map, "map");
60 }
61
62 @Override
63 public Map<K, Collection<V>> asMap() {
64 return decorated().asMap();
65 }
66
67 @Override
68 public void clear() {
69 decorated().clear();
70 }
71
72 @Override
73 public boolean containsKey(final Object key) {
74 return decorated().containsKey(key);
75 }
76
77 @Override
78 public boolean containsMapping(final Object key, final Object value) {
79 return decorated().containsMapping(key, value);
80 }
81
82 @Override
83 public boolean containsValue(final Object value) {
84 return decorated().containsValue(value);
85 }
86
87
88
89
90
91
92 protected MultiValuedMap<K, V> decorated() {
93 return map;
94 }
95
96 @Override
97 public Collection<Entry<K, V>> entries() {
98 return decorated().entries();
99 }
100
101 @Override
102 public boolean equals(final Object object) {
103 if (object == this) {
104 return true;
105 }
106 return decorated().equals(object);
107 }
108
109 @Override
110 public Collection<V> get(final K key) {
111 return decorated().get(key);
112 }
113
114 @Override
115 public int hashCode() {
116 return decorated().hashCode();
117 }
118
119 @Override
120 public boolean isEmpty() {
121 return decorated().isEmpty();
122 }
123
124 @Override
125 public MultiSet<K> keys() {
126 return decorated().keys();
127 }
128
129 @Override
130 public Set<K> keySet() {
131 return decorated().keySet();
132 }
133
134 @Override
135 public MapIterator<K, V> mapIterator() {
136 return decorated().mapIterator();
137 }
138
139 @Override
140 public boolean put(final K key, final V value) {
141 return decorated().put(key, value);
142 }
143
144 @Override
145 public boolean putAll(final K key, final Iterable<? extends V> values) {
146 return decorated().putAll(key, values);
147 }
148
149 @Override
150 public boolean putAll(final Map<? extends K, ? extends V> map) {
151 return decorated().putAll(map);
152 }
153
154 @Override
155 public boolean putAll(final MultiValuedMap<? extends K, ? extends V> map) {
156 return decorated().putAll(map);
157 }
158
159 @Override
160 public Collection<V> remove(final Object key) {
161 return decorated().remove(key);
162 }
163
164 @Override
165 public boolean removeMapping(final Object key, final Object item) {
166 return decorated().removeMapping(key, item);
167 }
168
169 @Override
170 public int size() {
171 return decorated().size();
172 }
173
174 @Override
175 public String toString() {
176 return decorated().toString();
177 }
178
179 @Override
180 public Collection<V> values() {
181 return decorated().values();
182 }
183
184 }