]> git.basschouten.com Git - openhab-addons.git/blob
23e47f5677a9793f82374357868d12cc94455536
[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.rfxcom.internal.messages;
14
15 import java.util.Map;
16 import java.util.concurrent.ConcurrentHashMap;
17
18 import org.openhab.binding.rfxcom.internal.handler.DeviceState;
19 import org.openhab.core.types.Type;
20
21 /**
22  * Mock implementation for the DeviceState
23  *
24  * @author Martin van Wingerden - Initial contribution
25  */
26 public class MockDeviceState implements DeviceState {
27     private final Map<String, Type> stateMap = new ConcurrentHashMap<>();
28
29     @Override
30     public Type getLastState(String channelId) {
31         return stateMap.get(channelId);
32     }
33
34     public void set(String channelId, Type state) {
35         stateMap.put(channelId, state);
36     }
37 }