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.List;
17 import com.fasterxml.jackson.annotation.JsonProperty;
20 * A PA-like Announcement IF no zones or groups are specified, all available zones are used
22 public class Announcement {
25 * URL to media to play as the announcement
32 private Integer vol = -40;
35 * Source to announce with
37 private Integer sourceId = 3;
40 * Set of zone ids belonging to a group
42 private List<Integer> zones = null;
47 private List<Integer> groups = null;
50 * URL to media to play as the announcement
54 @JsonProperty("media")
55 public String getMedia() {
59 public void setMedia(String media) {
63 public Announcement media(String media) {
76 public Integer getVol() {
80 public void setVol(Integer vol) {
84 public Announcement vol(Integer vol) {
90 * Source to announce with
96 @JsonProperty("source_id")
97 public Integer getSourceId() {
101 public void setSourceId(Integer sourceId) {
102 this.sourceId = sourceId;
105 public Announcement sourceId(Integer sourceId) {
106 this.sourceId = sourceId;
111 * Set of zone ids belonging to a group
115 @JsonProperty("zones")
116 public List<Integer> getZones() {
120 public void setZones(List<Integer> zones) {
124 public Announcement zones(List<Integer> zones) {
129 public Announcement addZonesItem(Integer zonesItem) {
130 this.zones.add(zonesItem);
139 @JsonProperty("groups")
140 public List<Integer> getGroups() {
144 public void setGroups(List<Integer> groups) {
145 this.groups = groups;
148 public Announcement groups(List<Integer> groups) {
149 this.groups = groups;
153 public Announcement addGroupsItem(Integer groupsItem) {
154 this.groups.add(groupsItem);
159 public String toString() {
160 StringBuilder sb = new StringBuilder();
161 sb.append("class Announcement {\n");
163 sb.append(" media: ").append(toIndentedString(media)).append("\n");
164 sb.append(" vol: ").append(toIndentedString(vol)).append("\n");
165 sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n");
166 sb.append(" zones: ").append(toIndentedString(zones)).append("\n");
167 sb.append(" groups: ").append(toIndentedString(groups)).append("\n");
169 return sb.toString();
173 * Convert the given object to string with each line indented by 4 spaces
174 * (except the first line).
176 private static String toIndentedString(Object o) {
180 return o.toString().replace("\n", "\n ");