]> git.basschouten.com Git - openhab-addons.git/blob
60ac6d37dd500345dc016d94d8238033e243c6e4
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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.boschshc.internal.devices.bridge.dto;
14
15 import org.openhab.binding.boschshc.internal.services.dto.BoschSHCServiceState;
16
17 /**
18  * Represents a single user-defined state defined on the Bosch Smart Home Controller.
19  *
20  * Example from Json:
21  *
22  * <pre>
23  * {
24  * "@type": "userDefinedState",
25  * "id": "23d34fa6-382a-444d-8aae-89c706e22158",
26  * "name": "atHome",
27  * "state": false
28  * }
29  * </pre>
30  *
31  * @author Patrick Gell - Initial contribution
32  */
33 public class UserDefinedState extends BoschSHCServiceState {
34
35     private String id;
36     private String name;
37     private boolean state;
38
39     public UserDefinedState() {
40         super("UserDefinedState");
41     }
42
43     public String getId() {
44         return id;
45     }
46
47     public void setId(String id) {
48         this.id = id;
49     }
50
51     public String getName() {
52         return name;
53     }
54
55     public void setName(String name) {
56         this.name = name;
57     }
58
59     public boolean isState() {
60         return state;
61     }
62
63     public void setState(boolean state) {
64         this.state = state;
65     }
66
67     @Override
68     public String toString() {
69         return "UserDefinedState{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", state=" + state + ", type='"
70                 + type + '\'' + '}';
71     }
72
73     public static Boolean isValid(UserDefinedState obj) {
74         return obj != null && obj.id != null;
75     }
76 }