]> git.basschouten.com Git - openhab-addons.git/blob
fd8a0cb71f123ea5e237b770bf807b990647197d
[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 Room (serialize/deserialize json use only).
20  *
21  * @author Tim Roberts - Initial contribution
22  */
23 @NonNullByDefault
24 public class NeeoRoom {
25
26     /** The room name */
27     @Nullable
28     private String name;
29
30     /** The room key */
31     @Nullable
32     private String key;
33
34     /** The devices in the room */
35     @Nullable
36     private NeeoDevices devices;
37
38     /** The scenarios in the room */
39     @Nullable
40     private NeeoScenarios scenarios;
41
42     /** The recipes in the room */
43     @Nullable
44     private NeeoRecipes recipes;
45
46     /**
47      * Gets the room name
48      *
49      * @return the name
50      */
51     @Nullable
52     public String getName() {
53         return name;
54     }
55
56     /**
57      * Gets the room key
58      *
59      * @return the key
60      */
61     @Nullable
62     public String getKey() {
63         return key;
64     }
65
66     /**
67      * Gets the recipes in the room
68      *
69      * @return the recipes
70      */
71     public NeeoRecipes getRecipes() {
72         final NeeoRecipes localRecipes = recipes;
73         return localRecipes == null ? new NeeoRecipes(new NeeoRecipe[0]) : localRecipes;
74     }
75
76     /**
77      * Gets the devices in the room
78      *
79      * @return the devices
80      */
81     public NeeoDevices getDevices() {
82         final NeeoDevices localDevices = devices;
83         return localDevices == null ? new NeeoDevices(new NeeoDevice[0]) : localDevices;
84     }
85
86     /**
87      * Gets the scenarios in the room
88      *
89      * @return the scenarios
90      */
91     public NeeoScenarios getScenarios() {
92         final NeeoScenarios localScenarios = scenarios;
93         return localScenarios == null ? new NeeoScenarios(new NeeoScenario[0]) : localScenarios;
94     }
95
96     @Override
97     public String toString() {
98         return "NeeoRoom [name=" + name + ", key=" + key + ", scenarios=" + scenarios + ", devices=" + devices
99                 + ", recipes=" + recipes + "]";
100     }
101 }