]> git.basschouten.com Git - openhab-addons.git/blob
b4be02a61de3ef4a90882f6047b4b762d81b6c6e
[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.avmfritz.internal.dto;
14
15 import java.math.BigDecimal;
16
17 import javax.xml.bind.annotation.XmlAccessType;
18 import javax.xml.bind.annotation.XmlAccessorType;
19 import javax.xml.bind.annotation.XmlElement;
20 import javax.xml.bind.annotation.XmlRootElement;
21
22 /**
23  * See {@link DeviceListModel}.
24  *
25  * @author Christoph Weitkamp - Initial contribution
26  */
27 @XmlAccessorType(XmlAccessType.FIELD)
28 @XmlRootElement(name = "humidity")
29 public class HumidityModel {
30
31     @XmlElement(name = "rel_humidity")
32     private BigDecimal relativeHumidity;
33
34     public BigDecimal getRelativeHumidity() {
35         return relativeHumidity != null ? relativeHumidity : BigDecimal.ZERO;
36     }
37
38     public void setRelativeHumidity(BigDecimal relativeHumidity) {
39         this.relativeHumidity = relativeHumidity;
40     }
41
42     @Override
43     public String toString() {
44         return new StringBuilder().append("[rel_humidity=").append(getRelativeHumidity()).append("]").toString();
45     }
46 }