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.monopriceaudio.internal.dto;
15 import static org.openhab.binding.monopriceaudio.internal.MonopriceAudioBindingConstants.*;
18 * Represents the data elements of a single zone of a supported amplifier
20 * @author Michael Lobstein - Initial contribution
22 public class MonopriceAudioZoneDTO {
24 private String zone = EMPTY;
25 private String page = EMPTY;
26 private String power = EMPTY;
27 private String mute = EMPTY;
28 private String dnd = EMPTY;
29 private int volume = NIL;
30 private int treble = NIL;
31 private int bass = NIL;
32 private int balance = NIL;
33 private String source = EMPTY;
34 private String keypad = EMPTY;
36 public MonopriceAudioZoneDTO() {
39 public MonopriceAudioZoneDTO(String zone) {
43 public void setZone(String zone) {
47 public String getZone() {
51 public void setPage(String page) {
55 public String getPage() {
59 public boolean isPageActive() {
60 return this.page.contains(ONE);
63 public void setPower(String power) {
67 public String getPower() {
71 public boolean isPowerOn() {
72 return this.power.contains(ONE);
75 public void setMute(String mute) {
79 public String getMute() {
83 public boolean isMuted() {
84 return this.mute.contains(ONE);
87 public void setDnd(String dnd) {
91 public String getDnd() {
95 public boolean isDndOn() {
96 return this.dnd.contains(ONE);
99 public int getVolume() {
103 public void setVolume(int volume) {
104 this.volume = volume;
107 public int getTreble() {
111 public void setTreble(int treble) {
112 this.treble = treble;
115 public int getBass() {
119 public void setBass(int bass) {
123 public int getBalance() {
127 public void setBalance(int balance) {
128 this.balance = balance;
131 public String getSource() {
135 public void setSource(String source) {
136 this.source = source;
139 public void setKeypad(String keypad) {
140 this.keypad = keypad;
143 public String getKeypad() {
147 public boolean isKeypadActive() {
148 return this.keypad.contains(ONE);
152 public String toString() {
153 // This is used to determine if something changed from the last polling update
154 return zone + page + power + mute + dnd + volume + treble + bass + balance + source + keypad;