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 public abstract class AbstractMultiValuedMapDecorator<K, V>
43 implements MultiValuedMap<K, V>, Serializable {
44
45
46 private static final long serialVersionUID = 20150612L;
47
48
49 private final MultiValuedMap<K, V> map;
50
51
52
53
54
55
56
57 protected AbstractMultiValuedMapDecorator(final MultiValuedMap<K, V> map) {
58 this.map = Objects.requireNonNull(map, "map");
59 }
60
61 @Override
62 public Map<K, Collection<V>> asMap() {
63 return decorated().asMap();
64 }
65
66 @Override
67 public void clear() {
68 decorated().clear();
69 }
70
71 @Override
72 public boolean containsKey(final Object key) {
73 return decorated().containsKey(key);
74 }
75
76 @Override
77 public boolean containsMapping(final Object key, final Object value) {
78 return decorated().containsMapping(key, value);
79 }
80
81 @Override
82 public boolean containsValue(final Object value) {
83 return decorated().containsValue(value);
84 }
85
86
87
88
89
90
91 protected MultiValuedMap<K, V> decorated() {
92 return map;
93 }
94
95 @Override
96 public Collection<Entry<K, V>> entries() {
97 return decorated().entries();
98 }
99
100 @Override
101 public boolean equals(final Object object) {
102 if (object == this) {
103 return true;
104 }
105 return decorated().equals(object);
106 }
107
108 @Override
109 public Collection<V> get(final K key) {
110 return decorated().get(key);
111 }
112
113 @Override
114 public int hashCode() {
115 return decorated().hashCode();
116 }
117
118 @Override
119 public boolean isEmpty() {
120 return decorated().isEmpty();
121 }
122
123 @Override
124 public MultiSet<K> keys() {
125 return decorated().keys();
126 }
127
128 @Override
129 public Set<K> keySet() {
130 return decorated().keySet();
131 }
132
133 @Override
134 public MapIterator<K, V> mapIterator() {
135 return decorated().mapIterator();
136 }
137
138 @Override
139 public boolean put(final K key, final V value) {
140 return decorated().put(key, value);
141 }
142
143 @Override
144 public boolean putAll(final K key, final Iterable<? extends V> values) {
145 return decorated().putAll(key, values);
146 }
147
148 @Override
149 public boolean putAll(final Map<? extends K, ? extends V> map) {
150 return decorated().putAll(map);
151 }
152
153 @Override
154 public boolean putAll(final MultiValuedMap<? extends K, ? extends V> map) {
155 return decorated().putAll(map);
156 }
157
158 @Override
159 public Collection<V> remove(final Object key) {
160 return decorated().remove(key);
161 }
162
163 @Override
164 public boolean removeMapping(final Object key, final Object item) {
165 return decorated().removeMapping(key, item);
166 }
167
168 @Override
169 public int size() {
170 return decorated().size();
171 }
172
173 @Override
174 public String toString() {
175 return decorated().toString();
176 }
177
178 @Override
179 public Collection<V> values() {
180 return decorated().values();
181 }
182
183 }