]> git.basschouten.com Git - openhab-addons.git/blob
4824193976f4622272fc64d322ac2376577d4126
[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.somfytahoma.internal.model;
14
15 import java.util.ArrayList;
16 import java.util.List;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19
20 /**
21  * The {@link SomfyTahomaDeviceDefinition} holds information about a device definition.
22  *
23  * @author Ondrej Pecta - Initial contribution
24  */
25 @NonNullByDefault
26 public class SomfyTahomaDeviceDefinition {
27
28     private List<SomfyTahomaDeviceDefinitionCommand> commands = new ArrayList<>();
29     private List<SomfyTahomaDeviceDefinitionState> states = new ArrayList<>();
30
31     public List<SomfyTahomaDeviceDefinitionCommand> getCommands() {
32         return commands;
33     }
34
35     public List<SomfyTahomaDeviceDefinitionState> getStates() {
36         return states;
37     }
38
39     private String widgetName = "";
40
41     private String uiClass = "";
42
43     public String getWidgetName() {
44         return widgetName;
45     }
46
47     public String getUiClass() {
48         return uiClass;
49     }
50
51     public void setWidgetName(String widgetName) {
52         this.widgetName = widgetName;
53     }
54
55     @Override
56     public String toString() {
57         StringBuilder sb = new StringBuilder();
58         sb.append("Commands: { ");
59         for (SomfyTahomaDeviceDefinitionCommand cmd : commands) {
60             sb.append(cmd.toString()).append("; ");
61         }
62
63         sb.append("}\nStates: {");
64         for (SomfyTahomaDeviceDefinitionState state : states) {
65             sb.append(state.toString()).append("; ");
66         }
67         sb.append("}");
68         return sb.toString();
69     }
70 }