]> git.basschouten.com Git - openhab-addons.git/blob
8c0aa561fa47fd2f06283e826e313fcdf1bba8f8
[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 java.util.List;
16
17 import com.fasterxml.jackson.annotation.JsonProperty;
18
19 /**
20  * Reconfiguration of multiple zones specified by zone_ids and group_ids
21  **/
22 public class MultiZoneUpdate {
23
24     /**
25      * Set of zone ids belonging to a group
26      **/
27     private List<Integer> zones = null;
28
29     /**
30      * List of group ids
31      **/
32     private List<Integer> groups = null;
33
34     private ZoneUpdate update;
35
36     /**
37      * Set of zone ids belonging to a group
38      *
39      * @return zones
40      **/
41     @JsonProperty("zones")
42     public List<Integer> getZones() {
43         return zones;
44     }
45
46     public void setZones(List<Integer> zones) {
47         this.zones = zones;
48     }
49
50     public MultiZoneUpdate zones(List<Integer> zones) {
51         this.zones = zones;
52         return this;
53     }
54
55     public MultiZoneUpdate addZonesItem(Integer zonesItem) {
56         this.zones.add(zonesItem);
57         return this;
58     }
59
60     /**
61      * List of group ids
62      *
63      * @return groups
64      **/
65     @JsonProperty("groups")
66     public List<Integer> getGroups() {
67         return groups;
68     }
69
70     public void setGroups(List<Integer> groups) {
71         this.groups = groups;
72     }
73
74     public MultiZoneUpdate groups(List<Integer> groups) {
75         this.groups = groups;
76         return this;
77     }
78
79     public MultiZoneUpdate addGroupsItem(Integer groupsItem) {
80         this.groups.add(groupsItem);
81         return this;
82     }
83
84     /**
85      * Get update
86      *
87      * @return update
88      **/
89     @JsonProperty("update")
90     public ZoneUpdate getUpdate() {
91         return update;
92     }
93
94     public void setUpdate(ZoneUpdate update) {
95         this.update = update;
96     }
97
98     public MultiZoneUpdate update(ZoneUpdate update) {
99         this.update = update;
100         return this;
101     }
102
103     @Override
104     public String toString() {
105         StringBuilder sb = new StringBuilder();
106         sb.append("class MultiZoneUpdate {\n");
107
108         sb.append("    zones: ").append(toIndentedString(zones)).append("\n");
109         sb.append("    groups: ").append(toIndentedString(groups)).append("\n");
110         sb.append("    update: ").append(toIndentedString(update)).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 }