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.google.gson.annotations.SerializedName;
19 import io.swagger.v3.oas.annotations.media.Schema;
22 * A partial controller configuration the can be loaded on demand. In addition to most of the configuration found in
23 * Status, this can contain commands as well that configure the state of different streaming services.
25 @Schema(description = "A partial controller configuration the can be loaded on demand. In addition to most of the configuration found in Status, this can contain commands as well that configure the state of different streaming services.")
34 @Schema(required = true)
40 @Schema(required = true)
41 private PresetState state;
44 private List<Command> commands = null;
47 @SerializedName("last_used")
48 private Integer lastUsed;
55 public Integer getId() {
59 public void setId(Integer id) {
63 public Preset id(Integer id) {
73 public String getName() {
77 public void setName(String name) {
81 public Preset name(String name) {
91 public PresetState getState() {
95 public void setState(PresetState state) {
99 public Preset state(PresetState state) {
109 public List<Command> getCommands() {
113 public void setCommands(List<Command> commands) {
114 this.commands = commands;
117 public Preset commands(List<Command> commands) {
118 this.commands = commands;
122 public Preset addCommandsItem(Command commandsItem) {
123 this.commands.add(commandsItem);
132 public Integer getLastUsed() {
136 public void setLastUsed(Integer lastUsed) {
137 this.lastUsed = lastUsed;
140 public Preset lastUsed(Integer lastUsed) {
141 this.lastUsed = lastUsed;
146 public String toString() {
147 StringBuilder sb = new StringBuilder();
148 sb.append("class Preset {\n");
150 sb.append(" id: ").append(toIndentedString(id)).append("\n");
151 sb.append(" name: ").append(toIndentedString(name)).append("\n");
152 sb.append(" state: ").append(toIndentedString(state)).append("\n");
153 sb.append(" commands: ").append(toIndentedString(commands)).append("\n");
154 sb.append(" lastUsed: ").append(toIndentedString(lastUsed)).append("\n");
156 return sb.toString();
160 * Convert the given object to string with each line indented by 4 spaces
161 * (except the first line).
163 private static String toIndentedString(Object o) {
167 return o.toString().replace("\n", "\n ");