]> git.basschouten.com Git - openhab-addons.git/blob
97dccec5e7ea3b1f737e27b0b7f278ea4240fc01
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.amplipi.internal.model;
14
15 import com.google.gson.annotations.SerializedName;
16
17 import io.swagger.v3.oas.annotations.media.Schema;
18
19 /**
20  * A command to execute on a stream
21  **/
22 @Schema(description = "A command to execute on a stream ")
23 public class Command {
24
25     @Schema(required = true)
26     @SerializedName("stream_id")
27     /**
28      * Stream to execute the command on
29      **/
30     private Integer streamId;
31
32     @Schema(required = true)
33     /**
34      * Command to execute
35      **/
36     private String cmd;
37
38     /**
39      * Stream to execute the command on
40      *
41      * @return streamId
42      **/
43     public Integer getStreamId() {
44         return streamId;
45     }
46
47     public void setStreamId(Integer streamId) {
48         this.streamId = streamId;
49     }
50
51     public Command streamId(Integer streamId) {
52         this.streamId = streamId;
53         return this;
54     }
55
56     /**
57      * Command to execute
58      *
59      * @return cmd
60      **/
61     public String getCmd() {
62         return cmd;
63     }
64
65     public void setCmd(String cmd) {
66         this.cmd = cmd;
67     }
68
69     public Command cmd(String cmd) {
70         this.cmd = cmd;
71         return this;
72     }
73
74     @Override
75     public String toString() {
76         StringBuilder sb = new StringBuilder();
77         sb.append("class Command {\n");
78
79         sb.append("    streamId: ").append(toIndentedString(streamId)).append("\n");
80         sb.append("    cmd: ").append(toIndentedString(cmd)).append("\n");
81         sb.append("}");
82         return sb.toString();
83     }
84
85     /**
86      * Convert the given object to string with each line indented by 4 spaces
87      * (except the first line).
88      */
89     private static String toIndentedString(Object o) {
90         if (o == null) {
91             return "null";
92         }
93         return o.toString().replace("\n", "\n    ");
94     }
95 }