]> git.basschouten.com Git - openhab-addons.git/blob
3994d18bd927982115265b0842107c4aac6d884b
[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.monopriceaudio.internal.dto;
14
15 import static org.openhab.binding.monopriceaudio.internal.MonopriceAudioBindingConstants.*;
16
17 /**
18  * Represents the data elements of a single zone of a supported amplifier
19  *
20  * @author Michael Lobstein - Initial contribution
21  */
22 public class MonopriceAudioZoneDTO {
23
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;
35
36     public MonopriceAudioZoneDTO() {
37     }
38
39     public MonopriceAudioZoneDTO(String zone) {
40         this.zone = zone;
41     }
42
43     public void setZone(String zone) {
44         this.zone = zone;
45     }
46
47     public String getZone() {
48         return this.zone;
49     }
50
51     public void setPage(String page) {
52         this.page = page;
53     }
54
55     public String getPage() {
56         return this.page;
57     }
58
59     public boolean isPageActive() {
60         return this.page.contains(ONE);
61     }
62
63     public void setPower(String power) {
64         this.power = power;
65     }
66
67     public String getPower() {
68         return this.power;
69     }
70
71     public boolean isPowerOn() {
72         return this.power.contains(ONE);
73     }
74
75     public void setMute(String mute) {
76         this.mute = mute;
77     }
78
79     public String getMute() {
80         return this.mute;
81     }
82
83     public boolean isMuted() {
84         return this.mute.contains(ONE);
85     }
86
87     public void setDnd(String dnd) {
88         this.dnd = dnd;
89     }
90
91     public String getDnd() {
92         return this.dnd;
93     }
94
95     public boolean isDndOn() {
96         return this.dnd.contains(ONE);
97     }
98
99     public int getVolume() {
100         return this.volume;
101     }
102
103     public void setVolume(int volume) {
104         this.volume = volume;
105     }
106
107     public int getTreble() {
108         return this.treble;
109     }
110
111     public void setTreble(int treble) {
112         this.treble = treble;
113     }
114
115     public int getBass() {
116         return this.bass;
117     }
118
119     public void setBass(int bass) {
120         this.bass = bass;
121     }
122
123     public int getBalance() {
124         return this.balance;
125     }
126
127     public void setBalance(int balance) {
128         this.balance = balance;
129     }
130
131     public String getSource() {
132         return this.source;
133     }
134
135     public void setSource(String source) {
136         this.source = source;
137     }
138
139     public void setKeypad(String keypad) {
140         this.keypad = keypad;
141     }
142
143     public String getKeypad() {
144         return this.keypad;
145     }
146
147     public boolean isKeypadActive() {
148         return this.keypad.contains(ONE);
149     }
150
151     @Override
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;
155     }
156 }