]> git.basschouten.com Git - openhab-addons.git/blob
15247bd5562f61d02614cb283658277543fedf73
[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.tellstick.internal.live.xml;
14
15 import javax.xml.bind.annotation.XmlAttribute;
16 import javax.xml.bind.annotation.XmlRootElement;
17 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
18
19 /**
20  * Class used to deserialize XML from Telldus Live.
21  *
22  * @author Jarle Hjortland - Initial contribution
23  */
24 @XmlRootElement(name = "data")
25 public class DataTypeValue {
26
27     @XmlAttribute(name = "name")
28     @XmlJavaTypeAdapter(value = NameToDataType.class)
29     private LiveDataType dataType;
30
31     @XmlAttribute(name = "value")
32     private String data;
33
34     private String unit;
35
36     private Integer scale;
37
38     public LiveDataType getName() {
39         return dataType;
40     }
41
42     public void setName(LiveDataType dataType) {
43         this.dataType = dataType;
44     }
45
46     public String getValue() {
47         return data;
48     }
49
50     public void setValue(String data) {
51         this.data = data;
52     }
53
54     @XmlAttribute(name = "unit")
55     public String getUnit() {
56         return unit;
57     }
58
59     public void setUnit(String unit) {
60         this.unit = unit;
61     }
62
63     @XmlAttribute(name = "scale")
64     public Integer getScale() {
65         return scale;
66     }
67
68     public void setScale(Integer scale) {
69         this.scale = scale;
70     }
71
72     @Override
73     public String toString() {
74         return "DataTypeValue [dataType=" + dataType + ", data=" + data + ", unit=" + unit + "]";
75     }
76 }