]> git.basschouten.com Git - openhab-addons.git/blob
844cdf414d440ce1bb7c834de5892e9f29f6338c
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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.yamahamusiccast.internal.dto;
14
15 import com.google.gson.annotations.SerializedName;
16
17 /**
18  * This class represents the UDP event received from the Yamaha model/device.
19  *
20  * @author Lennert Coopman - Initial contribution
21  */
22
23 public class UdpMessage {
24
25     @SerializedName("device_id")
26     private String deviceId;
27
28     public String getDeviceId() {
29         if (deviceId == null) {
30             deviceId = "";
31         }
32         return deviceId;
33     }
34
35     @SerializedName("main")
36     private Zone main;
37     @SerializedName("zone2")
38     private Zone zone2;
39     @SerializedName("zone3")
40     private Zone zone3;
41     @SerializedName("zone4")
42     private Zone zone4;
43     @SerializedName("netusb")
44     private NetUSB netusb;
45     @SerializedName("dist")
46     private Dist dist;
47
48     public Zone getMain() {
49         return main;
50     }
51
52     public Zone getZone2() {
53         return zone2;
54     }
55
56     public Zone getZone3() {
57         return zone3;
58     }
59
60     public Zone getZone4() {
61         return zone4;
62     }
63
64     public NetUSB getNetUSB() {
65         return netusb;
66     }
67
68     public Dist getDist() {
69         return dist;
70     }
71
72     public class Zone {
73         @SerializedName("power")
74         private String power;
75         @SerializedName("volume")
76         private int volume = 0;
77         @SerializedName("mute")
78         private String mute;
79         @SerializedName("input")
80         private String input;
81         @SerializedName("status_updated")
82         private String statusUpdated;
83
84         public String getPower() {
85             if (power == null) {
86                 power = "";
87             }
88             return power;
89         }
90
91         public String getMute() {
92             if (mute == null) {
93                 mute = "";
94             }
95             return mute;
96         }
97
98         public String getInput() {
99             if (input == null) {
100                 input = "";
101             }
102             return input;
103         }
104
105         public int getVolume() {
106             return volume;
107         }
108
109         public String getstatusUpdated() {
110             if (statusUpdated == null) {
111                 statusUpdated = "";
112             }
113             return statusUpdated;
114         }
115     }
116
117     public class NetUSB {
118         @SerializedName("preset_control")
119         private PresetControl presetControl;
120         @SerializedName("play_info_updated")
121         private String playInfoUpdated;
122         @SerializedName("play_time")
123         private int playTime;
124
125         public PresetControl getPresetControl() {
126             return presetControl;
127         }
128
129         public String getPlayInfoUpdated() {
130             if (playInfoUpdated == null) {
131                 playInfoUpdated = "";
132             }
133             return playInfoUpdated;
134         }
135
136         public int getPlayTime() {
137             return playTime;
138         }
139     }
140
141     public class PresetControl {
142         @SerializedName("type")
143         private String type;
144         @SerializedName("num")
145         private int num = 1;
146         @SerializedName("result")
147         private String result;
148
149         public String getType() {
150             if (type == null) {
151                 type = "";
152             }
153             return type;
154         }
155
156         public String getResult() {
157             if (result == null) {
158                 result = "";
159             }
160             return result;
161         }
162
163         public int getNum() {
164             return num;
165         }
166     }
167
168     public class Dist {
169         @SerializedName("dist_info_updated")
170         private String distInfoUpdated;
171
172         public String getDistInfoUpdated() {
173             if (distInfoUpdated == null) {
174                 distInfoUpdated = "";
175             }
176             return distInfoUpdated;
177         }
178     }
179 }