]> git.basschouten.com Git - openhab-addons.git/blob
9a83d3e4e42f2ece392893b6719ff78bb656e163
[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.neeo.internal.models;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * The model representing a NEEO Device (serialize/deserialize json use only)
20  *
21  * @author Tim Roberts - Initial contribution
22  */
23 @NonNullByDefault
24 public class NeeoDevice {
25
26     /** The device name */
27     @Nullable
28     private String name;
29
30     /** The associated room name */
31     @Nullable
32     private String roomName;
33
34     /** The associated room key */
35     @Nullable
36     private String roomKey;
37
38     /** The adapter device id */
39     @Nullable
40     private String adapterDeviceId;
41
42     /** The device key */
43     @Nullable
44     private String key;
45
46     /** The macros for the device */
47     @Nullable
48     private NeeoMacros macros;
49
50     /** The device details */
51     @Nullable
52     private NeeoDeviceDetails details;
53
54     /**
55      * Gets the device name
56      *
57      * @return the name
58      */
59     @Nullable
60     public String getName() {
61         return name;
62     }
63
64     /**
65      * Gets the associated room name
66      *
67      * @return the room name
68      */
69     @Nullable
70     public String getRoomName() {
71         return roomName;
72     }
73
74     /**
75      * Gets the associated room key
76      *
77      * @return the room key
78      */
79     @Nullable
80     public String getRoomKey() {
81         return roomKey;
82     }
83
84     /**
85      * Gets the adapter device id
86      *
87      * @return the adapter device id
88      */
89     @Nullable
90     public String getAdapterDeviceId() {
91         return adapterDeviceId;
92     }
93
94     /**
95      * Gets the macro key
96      *
97      * @return the key
98      */
99     @Nullable
100     public String getKey() {
101         return key;
102     }
103
104     /**
105      * Gets the macros for the device
106      *
107      * @return the macros
108      */
109     public NeeoMacros getMacros() {
110         final NeeoMacros localMacros = macros;
111         return localMacros == null ? new NeeoMacros(new NeeoMacro[0]) : localMacros;
112     }
113
114     /**
115      * Gets the details for the device
116      *
117      * @return the details
118      */
119     @Nullable
120     public NeeoDeviceDetails getDetails() {
121         return details;
122     }
123
124     @Override
125     public String toString() {
126         return "NeeoDevice [name=" + name + ", roomName=" + roomName + ", roomKey=" + roomKey + ", adapterDeviceId="
127                 + adapterDeviceId + ", key=" + key + ", macros=" + macros + ", details=" + details + "]";
128     }
129 }