]> git.basschouten.com Git - openhab-addons.git/blob
b64b187f24cf7b8f5719acf71a486359314c99a2
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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  * An audio source
19  **/
20 @Schema(description = "An audio source ")
21 public class Source {
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
36     /**
37      * Connected audio source * Digital Stream ('stream=SID') where SID is the ID of the connected stream * Analog RCA
38      * Input ('local') connects to the RCA inputs associated * Nothing ('') behind the scenes this is muxed to a digital
39      * output
40      **/
41     private String input = "";
42
43     /**
44      * Unique identifier
45      *
46      * @return id
47      **/
48     public Integer getId() {
49         return id;
50     }
51
52     public void setId(Integer id) {
53         this.id = id;
54     }
55
56     public Source id(Integer id) {
57         this.id = id;
58         return this;
59     }
60
61     /**
62      * Friendly name
63      *
64      * @return name
65      **/
66     public String getName() {
67         return name;
68     }
69
70     public void setName(String name) {
71         this.name = name;
72     }
73
74     public Source name(String name) {
75         this.name = name;
76         return this;
77     }
78
79     /**
80      * Connected audio source * Digital Stream ('stream=SID') where SID is the ID of the connected stream *
81      * Analog RCA Input ('local') connects to the RCA inputs associated * Nothing ('') behind the scenes
82      * this is muxed to a digital output
83      *
84      * @return input
85      **/
86     public String getInput() {
87         return input;
88     }
89
90     public void setInput(String input) {
91         this.input = input;
92     }
93
94     public Source input(String input) {
95         this.input = input;
96         return this;
97     }
98
99     @Override
100     public String toString() {
101         StringBuilder sb = new StringBuilder();
102         sb.append("class Source {\n");
103
104         sb.append("    id: ").append(toIndentedString(id)).append("\n");
105         sb.append("    name: ").append(toIndentedString(name)).append("\n");
106         sb.append("    input: ").append(toIndentedString(input)).append("\n");
107         sb.append("}");
108         return sb.toString();
109     }
110
111     /**
112      * Convert the given object to string with each line indented by 4 spaces
113      * (except the first line).
114      */
115     private static String toIndentedString(Object o) {
116         if (o == null) {
117             return "null";
118         }
119         return o.toString().replace("\n", "\n    ");
120     }
121 }