2 * Copyright (c) 2010-2022 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.webthing.internal.link;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.core.types.Command;
17 import org.openhab.core.types.State;
20 * The {@link TypeConverter} class map Item state <-> Property value
22 * @author Gregor Roth - Initial contribution
25 interface TypeConverter {
28 * * maps a Property value to an Item state command
30 * @param propertyValue the Property value
31 * @return the Item state command
33 Command toStateCommand(Object propertyValue);
36 * maps an Item state to a Property value
38 * @param state the Item state
39 * @return the Property value
41 Object toPropertyValue(State state);