]> git.basschouten.com Git - openhab-addons.git/blob
e49ec2ac9d7bca55e35b14942a77b8fe4444fc73
[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.amplipi.internal.model;
14
15 import io.swagger.v3.oas.annotations.media.Schema;
16
17 /**
18  * Digital stream such as Pandora, Airplay or Spotify
19  **/
20 @Schema(description = "Digital stream such as Pandora, Airplay or Spotify ")
21 public class Stream {
22
23     @Schema
24     /**
25      * Unique identifier
26      **/
27     private Integer id;
28
29     @Schema(required = true)
30     /**
31      * Friendly name
32      **/
33     private String name;
34
35     @Schema(required = true)
36     /**
37      * stream type * pandora * shairport * dlna * internetradio * spotify
38      **/
39     private String type;
40
41     @Schema
42     /**
43      * User login
44      **/
45     private String user;
46
47     @Schema
48     /**
49      * Password
50      **/
51     private String password;
52
53     @Schema
54     /**
55      * Radio station identifier
56      **/
57     private String station;
58
59     @Schema
60     /**
61      * Stream url, used for internetradio
62      **/
63     private String url;
64
65     @Schema
66     /**
67      * Icon/Logo url, used for internetradio
68      **/
69     private String logo;
70
71     @Schema
72     /**
73      * Additional info about the current audio playing from the stream (generated during playback
74      **/
75     private Object info;
76
77     @Schema
78     /**
79      * State of the stream
80      **/
81     private String status;
82
83     /**
84      * Unique identifier
85      *
86      * @return id
87      **/
88     public Integer getId() {
89         return id;
90     }
91
92     public void setId(Integer id) {
93         this.id = id;
94     }
95
96     public Stream id(Integer id) {
97         this.id = id;
98         return this;
99     }
100
101     /**
102      * Friendly name
103      *
104      * @return name
105      **/
106     public String getName() {
107         return name;
108     }
109
110     public void setName(String name) {
111         this.name = name;
112     }
113
114     public Stream name(String name) {
115         this.name = name;
116         return this;
117     }
118
119     /**
120      * stream type * pandora * shairport * dlna * internetradio * spotify
121      *
122      * @return type
123      **/
124     public String getType() {
125         return type;
126     }
127
128     public void setType(String type) {
129         this.type = type;
130     }
131
132     public Stream type(String type) {
133         this.type = type;
134         return this;
135     }
136
137     /**
138      * User login
139      *
140      * @return user
141      **/
142     public String getUser() {
143         return user;
144     }
145
146     public void setUser(String user) {
147         this.user = user;
148     }
149
150     public Stream user(String user) {
151         this.user = user;
152         return this;
153     }
154
155     /**
156      * Password
157      *
158      * @return password
159      **/
160     public String getPassword() {
161         return password;
162     }
163
164     public void setPassword(String password) {
165         this.password = password;
166     }
167
168     public Stream password(String password) {
169         this.password = password;
170         return this;
171     }
172
173     /**
174      * Radio station identifier
175      *
176      * @return station
177      **/
178     public String getStation() {
179         return station;
180     }
181
182     public void setStation(String station) {
183         this.station = station;
184     }
185
186     public Stream station(String station) {
187         this.station = station;
188         return this;
189     }
190
191     /**
192      * Stream url, used for internetradio
193      *
194      * @return url
195      **/
196     public String getUrl() {
197         return url;
198     }
199
200     public void setUrl(String url) {
201         this.url = url;
202     }
203
204     public Stream url(String url) {
205         this.url = url;
206         return this;
207     }
208
209     /**
210      * Icon/Logo url, used for internetradio
211      *
212      * @return logo
213      **/
214     public String getLogo() {
215         return logo;
216     }
217
218     public void setLogo(String logo) {
219         this.logo = logo;
220     }
221
222     public Stream logo(String logo) {
223         this.logo = logo;
224         return this;
225     }
226
227     /**
228      * Additional info about the current audio playing from the stream (generated during playback
229      *
230      * @return info
231      **/
232     public Object getInfo() {
233         return info;
234     }
235
236     public void setInfo(Object info) {
237         this.info = info;
238     }
239
240     public Stream info(Object info) {
241         this.info = info;
242         return this;
243     }
244
245     /**
246      * State of the stream
247      *
248      * @return status
249      **/
250     public String getStatus() {
251         return status;
252     }
253
254     public void setStatus(String status) {
255         this.status = status;
256     }
257
258     public Stream status(String status) {
259         this.status = status;
260         return this;
261     }
262
263     @Override
264     public String toString() {
265         StringBuilder sb = new StringBuilder();
266         sb.append("class Stream {\n");
267
268         sb.append("    id: ").append(toIndentedString(id)).append("\n");
269         sb.append("    name: ").append(toIndentedString(name)).append("\n");
270         sb.append("    type: ").append(toIndentedString(type)).append("\n");
271         sb.append("    user: ").append(toIndentedString(user)).append("\n");
272         sb.append("    password: ").append(toIndentedString(password)).append("\n");
273         sb.append("    station: ").append(toIndentedString(station)).append("\n");
274         sb.append("    url: ").append(toIndentedString(url)).append("\n");
275         sb.append("    logo: ").append(toIndentedString(logo)).append("\n");
276         sb.append("    info: ").append(toIndentedString(info)).append("\n");
277         sb.append("    status: ").append(toIndentedString(status)).append("\n");
278         sb.append("}");
279         return sb.toString();
280     }
281
282     /**
283      * Convert the given object to string with each line indented by 4 spaces
284      * (except the first line).
285      */
286     private static String toIndentedString(Object o) {
287         if (o == null) {
288             return "null";
289         }
290         return o.toString().replace("\n", "\n    ");
291     }
292 }