]> git.basschouten.com Git - openhab-addons.git/blob
8f440ec28d482b92d1846a74aaea15a85c9460a3
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
7  * This program and the accompanying materials are made available under the
8  * terms of the Eclipse Public License 2.0 which is available at
9  * http://www.eclipse.org/legal/epl-2.0
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.plugwiseha.internal.api.model.dto;
14
15 import java.util.Collection;
16 import java.util.HashMap;
17 import java.util.Map;
18 import java.util.Set;
19
20 /**
21  * @author B. van Wetten - Initial contribution
22  */
23 public abstract class PlugwiseHACollection<T> implements Map<String, T> {
24
25     private final Map<String, T> map = new HashMap<>();
26
27     @Override
28     public int size() {
29         return this.map.size();
30     }
31
32     @Override
33     public boolean isEmpty() {
34         return this.map.isEmpty();
35     }
36
37     @Override
38     public boolean containsKey(Object key) {
39         return this.map.containsKey(key);
40     }
41
42     @Override
43     public boolean containsValue(Object value) {
44         return this.map.containsValue(value);
45     }
46
47     @Override
48     public T get(Object key) {
49         return this.map.get(key);
50     }
51
52     @Override
53     public T put(String key, T value) {
54         return this.map.put(key, value);
55     }
56
57     @Override
58     public T remove(Object key) {
59         return this.map.remove(key);
60     }
61
62     @Override
63     public void putAll(Map<? extends String, ? extends T> m) {
64         this.map.putAll(m);
65     }
66
67     @Override
68     public void clear() {
69         this.map.clear();
70     }
71
72     @Override
73     public Set<String> keySet() {
74         return this.map.keySet();
75     }
76
77     @Override
78     public Collection<T> values() {
79         return this.map.values();
80     }
81
82     @Override
83     public Set<Entry<String, T>> entrySet() {
84         return this.map.entrySet();
85     }
86
87     public abstract void merge(Map<String, T> map);
88 }