]> git.basschouten.com Git - openhab-addons.git/blob
776cd4846f6399ca4e1b90997f3d99840b2ef56d
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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 Brain(serialize/deserialize json use only)
20  *
21  * @author Tim Roberts - Initial contribution
22  */
23 @NonNullByDefault
24 public class NeeoBrain {
25
26     /** The brain name */
27     @Nullable
28     private String name;
29
30     /** The version of the brain */
31     @Nullable
32     private String version;
33
34     /** The brain's label */
35     @Nullable
36     private String label;
37
38     /** Whether the brain has been configured */
39     private boolean configured;
40
41     /** The brain key */
42     @Nullable
43     private String key;
44
45     /** ?? The brain airkey ?? */
46     @Nullable
47     private String airkey;
48
49     /** Last time the brain was changed */
50     private long lastchange;
51
52     /** The rooms in the brain */
53     @Nullable
54     private NeeoRooms rooms;
55
56     /**
57      * Gets the brain name
58      *
59      * @return the name
60      */
61     @Nullable
62     public String getName() {
63         return name;
64     }
65
66     /**
67      * Gets the version of the brain
68      *
69      * @return the version
70      */
71     @Nullable
72     public String getVersion() {
73         return version;
74     }
75
76     /**
77      * Gets the brain's label
78      *
79      * @return the label
80      */
81     @Nullable
82     public String getLabel() {
83         return label;
84     }
85
86     /**
87      * Checks if the brain is configured
88      *
89      * @return true, if is configured
90      */
91     public boolean isConfigured() {
92         return configured;
93     }
94
95     /**
96      * Gets the brain key
97      *
98      * @return the key
99      */
100     @Nullable
101     public String getKey() {
102         return key;
103     }
104
105     /**
106      * Gets the brain's airkey
107      *
108      * @return the airkey
109      */
110     @Nullable
111     public String getAirkey() {
112         return airkey;
113     }
114
115     /**
116      * Gets the last time the brain was changed
117      *
118      * @return the lastchange
119      */
120     public long getLastChange() {
121         return lastchange;
122     }
123
124     /**
125      * Gets the rooms in the brain
126      *
127      * @return the rooms
128      */
129     public NeeoRooms getRooms() {
130         final NeeoRooms localRooms = rooms;
131         return localRooms == null ? new NeeoRooms(new NeeoRoom[0]) : localRooms;
132     }
133
134     @Override
135     public String toString() {
136         return "NeeoBrain [name=" + name + ", version=" + version + ", label=" + label + ", configured=" + configured
137                 + ", key=" + key + ", airkey=" + airkey + ", lastchange=" + lastchange + ", rooms=" + rooms + "]";
138     }
139 }