]> git.basschouten.com Git - openhab-addons.git/blob
c252b84f389cdaa9f2ce7f45fcb5e97322a01216
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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     @Override
40     public String toString() {
41         StringBuilder sb = new StringBuilder();
42         sb.append("Commands: { ");
43         for (SomfyTahomaDeviceDefinitionCommand cmd : commands) {
44             sb.append(cmd.toString()).append("; ");
45         }
46
47         sb.append("}\nStates: {");
48         for (SomfyTahomaDeviceDefinitionState state : states) {
49             sb.append(state.toString()).append("; ");
50         }
51         sb.append("}");
52         return sb.toString();
53     }
54 }