2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.amplipi.internal.model;
15 import java.util.LinkedHashSet;
18 import com.google.gson.annotations.SerializedName;
20 import io.swagger.v3.oas.annotations.media.Schema;
23 * A group of zones that can share the same audio input and be controlled as a group ie. Updstairs. Volume, mute, and
24 * source_id fields are aggregates of the member zones.
26 @Schema(description = "A group of zones that can share the same audio input and be controlled as a group ie. Updstairs. Volume, mute, and source_id fields are aggregates of the member zones.")
35 @Schema(required = true)
42 @SerializedName("source_id")
44 * id of the connected source
46 private Integer sourceId = 0;
48 @Schema(required = true)
50 * Set of zones belonging to a group
52 private Set<Integer> zones = new LinkedHashSet<Integer>();
56 * Set to true if output is all zones muted
58 private Boolean mute = true;
61 @SerializedName("vol_delta")
63 * Average utput volume in dB
65 private Integer volDelta = -79;
72 public Integer getId() {
76 public void setId(Integer id) {
80 public Group id(Integer id) {
90 public String getName() {
94 public void setName(String name) {
98 public Group name(String name) {
104 * id of the connected source
110 public Integer getSourceId() {
114 public void setSourceId(Integer sourceId) {
115 this.sourceId = sourceId;
118 public Group sourceId(Integer sourceId) {
119 this.sourceId = sourceId;
124 * Set of zones belonging to a group
128 public Set<Integer> getZones() {
132 public void setZones(Set<Integer> zones) {
136 public Group zones(Set<Integer> zones) {
141 public Group addZonesItem(Integer zonesItem) {
142 this.zones.add(zonesItem);
147 * Set to true if output is all zones muted
151 public Boolean getMute() {
155 public void setMute(Boolean mute) {
159 public Group mute(Boolean mute) {
165 * Average utput volume in dB
171 public Integer getVolDelta() {
175 public void setVolDelta(Integer volDelta) {
176 this.volDelta = volDelta;
179 public Group volDelta(Integer volDelta) {
180 this.volDelta = volDelta;
185 public String toString() {
186 StringBuilder sb = new StringBuilder();
187 sb.append("class Group {\n");
189 sb.append(" id: ").append(toIndentedString(id)).append("\n");
190 sb.append(" name: ").append(toIndentedString(name)).append("\n");
191 sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n");
192 sb.append(" zones: ").append(toIndentedString(zones)).append("\n");
193 sb.append(" mute: ").append(toIndentedString(mute)).append("\n");
194 sb.append(" volDelta: ").append(toIndentedString(volDelta)).append("\n");
196 return sb.toString();
200 * Convert the given object to string with each line indented by 4 spaces
201 * (except the first line).
203 private static String toIndentedString(Object o) {
207 return o.toString().replace("\n", "\n ");