]> git.basschouten.com Git - openhab-addons.git/blob
92005ba25514cc31d07a32cd7f810cc5ad2761a0
[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.webthing.internal.link;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.types.Command;
17 import org.openhab.core.types.State;
18
19 /**
20  * The {@link TypeConverter} class map Item state <-> Property value
21  *
22  * @author Gregor Roth - Initial contribution
23  */
24 @NonNullByDefault
25 interface TypeConverter {
26
27     /**
28      * * maps a Property value to an Item state command
29      * 
30      * @param propertyValue the Property value
31      * @return the Item state command
32      */
33     Command toStateCommand(Object propertyValue);
34
35     /**
36      * maps an Item state to a Property value
37      * 
38      * @param state the Item state
39      * @return the Property value
40      */
41     Object toPropertyValue(State state);
42 }