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 io.swagger.v3.oas.annotations.media.Schema;
20 * Changes to a current preset The contents of state and commands will be completely replaced if populated. Merging old
21 * and new updates seems too complicated and error prone.
23 @Schema(description = "Changes to a current preset The contents of state and commands will be completely replaced if populated. Merging old and new updates seems too complicated and error prone.")
24 public class PresetUpdate {
33 private PresetState state;
36 private List<Command> commands = null;
43 public String getName() {
47 public void setName(String name) {
51 public PresetUpdate name(String name) {
61 public PresetState getState() {
65 public void setState(PresetState state) {
69 public PresetUpdate state(PresetState state) {
79 public List<Command> getCommands() {
83 public void setCommands(List<Command> commands) {
84 this.commands = commands;
87 public PresetUpdate commands(List<Command> commands) {
88 this.commands = commands;
92 public PresetUpdate addCommandsItem(Command commandsItem) {
93 this.commands.add(commandsItem);
98 public String toString() {
99 StringBuilder sb = new StringBuilder();
100 sb.append("class PresetUpdate {\n");
102 sb.append(" name: ").append(toIndentedString(name)).append("\n");
103 sb.append(" state: ").append(toIndentedString(state)).append("\n");
104 sb.append(" commands: ").append(toIndentedString(commands)).append("\n");
106 return sb.toString();
110 * Convert the given object to string with each line indented by 4 spaces
111 * (except the first line).
113 private static String toIndentedString(Object o) {
117 return o.toString().replace("\n", "\n ");