2 * Copyright (c) 2010-2022 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 io.swagger.v3.oas.annotations.media.Schema;
20 * A set of partial configuration changes to make to sources, zones, and groups
22 @Schema(description = "A set of partial configuration changes to make to sources, zones, and groups ")
23 public class PresetState {
26 private List<SourceUpdate2> sources = null;
29 private List<ZoneUpdate2> zones = null;
32 private List<GroupUpdate2> groups = null;
39 public List<SourceUpdate2> getSources() {
43 public void setSources(List<SourceUpdate2> sources) {
44 this.sources = sources;
47 public PresetState sources(List<SourceUpdate2> sources) {
48 this.sources = sources;
52 public PresetState addSourcesItem(SourceUpdate2 sourcesItem) {
53 this.sources.add(sourcesItem);
62 public List<ZoneUpdate2> getZones() {
66 public void setZones(List<ZoneUpdate2> zones) {
70 public PresetState zones(List<ZoneUpdate2> zones) {
75 public PresetState addZonesItem(ZoneUpdate2 zonesItem) {
76 this.zones.add(zonesItem);
85 public List<GroupUpdate2> getGroups() {
89 public void setGroups(List<GroupUpdate2> groups) {
93 public PresetState groups(List<GroupUpdate2> groups) {
98 public PresetState addGroupsItem(GroupUpdate2 groupsItem) {
99 this.groups.add(groupsItem);
104 public String toString() {
105 StringBuilder sb = new StringBuilder();
106 sb.append("class PresetState {\n");
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");
112 return sb.toString();
116 * Convert the given object to string with each line indented by 4 spaces
117 * (except the first line).
119 private static String toIndentedString(Object o) {
123 return o.toString().replace("\n", "\n ");