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.avmfritz.internal.dto;
15 import java.math.BigDecimal;
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;
23 * See {@link DeviceListModel}.
25 * @author Ulrich Mertin - Initial contribution
27 @XmlAccessorType(XmlAccessType.FIELD)
28 @XmlRootElement(name = "levelcontrol")
29 public class LevelControlModel {
31 @XmlElement(name = "level")
32 private BigDecimal level;
34 @XmlElement(name = "levelpercentage")
35 private BigDecimal levelPercentage;
37 public BigDecimal getLevel() {
38 return level != null ? level : BigDecimal.ZERO;
41 public void setLevel(BigDecimal level) {
45 public BigDecimal getLevelPercentage() {
46 return levelPercentage != null ? levelPercentage : BigDecimal.ZERO;
49 public void setLevelPercentage(BigDecimal levelPercentage) {
50 this.levelPercentage = levelPercentage;
54 public String toString() {
55 return new StringBuilder("[level=").append(getLevel()).append(",levelpercentage=").append(getLevelPercentage())
56 .append("]").toString();