]> git.basschouten.com Git - openhab-addons.git/blob
406a82281ab7e1fe9f8b687def4a3bbe7680fb5b
[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 java.util.List;
16
17 import io.swagger.v3.oas.annotations.media.Schema;
18
19 /**
20  * A set of partial configuration changes to make to sources, zones, and groups
21  **/
22 @Schema(description = "A set of partial configuration changes to make to sources, zones, and groups ")
23 public class PresetState {
24
25     @Schema
26     private List<SourceUpdate2> sources = null;
27
28     @Schema
29     private List<ZoneUpdate2> zones = null;
30
31     @Schema
32     private List<GroupUpdate2> groups = null;
33
34     /**
35      * Get sources
36      *
37      * @return sources
38      **/
39     public List<SourceUpdate2> getSources() {
40         return sources;
41     }
42
43     public void setSources(List<SourceUpdate2> sources) {
44         this.sources = sources;
45     }
46
47     public PresetState sources(List<SourceUpdate2> sources) {
48         this.sources = sources;
49         return this;
50     }
51
52     public PresetState addSourcesItem(SourceUpdate2 sourcesItem) {
53         this.sources.add(sourcesItem);
54         return this;
55     }
56
57     /**
58      * Get zones
59      *
60      * @return zones
61      **/
62     public List<ZoneUpdate2> getZones() {
63         return zones;
64     }
65
66     public void setZones(List<ZoneUpdate2> zones) {
67         this.zones = zones;
68     }
69
70     public PresetState zones(List<ZoneUpdate2> zones) {
71         this.zones = zones;
72         return this;
73     }
74
75     public PresetState addZonesItem(ZoneUpdate2 zonesItem) {
76         this.zones.add(zonesItem);
77         return this;
78     }
79
80     /**
81      * Get groups
82      *
83      * @return groups
84      **/
85     public List<GroupUpdate2> getGroups() {
86         return groups;
87     }
88
89     public void setGroups(List<GroupUpdate2> groups) {
90         this.groups = groups;
91     }
92
93     public PresetState groups(List<GroupUpdate2> groups) {
94         this.groups = groups;
95         return this;
96     }
97
98     public PresetState addGroupsItem(GroupUpdate2 groupsItem) {
99         this.groups.add(groupsItem);
100         return this;
101     }
102
103     @Override
104     public String toString() {
105         StringBuilder sb = new StringBuilder();
106         sb.append("class PresetState {\n");
107
108         sb.append("    sources: ").append(toIndentedString(sources)).append("\n");
109         sb.append("    zones: ").append(toIndentedString(zones)).append("\n");
110         sb.append("    groups: ").append(toIndentedString(groups)).append("\n");
111         sb.append("}");
112         return sb.toString();
113     }
114
115     /**
116      * Convert the given object to string with each line indented by 4 spaces
117      * (except the first line).
118      */
119     private static String toIndentedString(Object o) {
120         if (o == null) {
121             return "null";
122         }
123         return o.toString().replace("\n", "\n    ");
124     }
125 }