2 * Copyright (c) 2010-2023 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.tellstick.internal.live.xml;
15 import javax.xml.bind.annotation.XmlAttribute;
16 import javax.xml.bind.annotation.XmlRootElement;
17 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
20 * Class used to deserialize XML from Telldus Live.
22 * @author Jarle Hjortland - Initial contribution
24 @XmlRootElement(name = "data")
25 public class DataTypeValue {
27 @XmlAttribute(name = "name")
28 @XmlJavaTypeAdapter(value = NameToDataType.class)
29 private LiveDataType dataType;
31 @XmlAttribute(name = "value")
36 private Integer scale;
38 public LiveDataType getName() {
42 public void setName(LiveDataType dataType) {
43 this.dataType = dataType;
46 public String getValue() {
50 public void setValue(String data) {
54 @XmlAttribute(name = "unit")
55 public String getUnit() {
59 public void setUnit(String unit) {
63 @XmlAttribute(name = "scale")
64 public Integer getScale() {
68 public void setScale(Integer scale) {
73 public String toString() {
74 return "DataTypeValue [dataType=" + dataType + ", data=" + data + ", unit=" + unit + "]";