]> git.basschouten.com Git - openhab-addons.git/blob
30bd82ce4712e8e870f38a07a659ed57976532d0
[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 Recipe (serialize/deserialize json use only).
20  *
21  * @author Tim Roberts - Initial contribution
22  */
23 @NonNullByDefault
24 public class NeeoRecipe {
25
26     /** Recipe type for launching the recipe */
27     public static final String LAUNCH = "launch";
28
29     /** Recipe type for powering off the recipe */
30     public static final String POWEROFF = "poweroff";
31
32     /** The recipe key */
33     @Nullable
34     private String key;
35
36     /** The type of recipe (generally launch/poweroff) */
37     @Nullable
38     private String type;
39
40     /** The name of the recipe */
41     @Nullable
42     private String name;
43
44     /** Whether the recipe is enabled */
45     private boolean enabled;
46
47     /** ?? whether the recipe is dirty ?? */
48     private boolean dirty;
49
50     // May be used in the future...
51     // private NeeoStep[] steps;
52     // private NeeoCondition[] conditions;
53     // private NeeoTrigger trigger;
54
55     /** The associated room key */
56     @Nullable
57     private String roomKey;
58
59     /** The associated room name. */
60     @Nullable
61     private String roomName;
62
63     /** The scenario key recipe is linked to */
64     @Nullable
65     private String scenarioKey;
66
67     /** Whether the recipe is hidden or not */
68     private boolean isHiddenRecipe;
69
70     /** ?? whether this is a custom recipe ?? */
71     private boolean isCustom;
72
73     /**
74      * Gets the recipe key
75      *
76      * @return the key
77      */
78     @Nullable
79     public String getKey() {
80         return key;
81     }
82
83     /**
84      * Gets the recipe type
85      *
86      * @return the type
87      */
88     @Nullable
89     public String getType() {
90         return type;
91     }
92
93     /**
94      * Gets the recipe name
95      *
96      * @return the name
97      */
98     @Nullable
99     public String getName() {
100         return name;
101     }
102
103     /**
104      * Checks if the recipe is enabled
105      *
106      * @return true, if is enabled
107      */
108     public boolean isEnabled() {
109         return enabled;
110     }
111
112     /**
113      * Checks if the recipe is dirty
114      *
115      * @return true, if is dirty
116      */
117     public boolean isDirty() {
118         return dirty;
119     }
120
121     /**
122      * Gets the associated room key.
123      *
124      * @return the room key
125      */
126     @Nullable
127     public String getRoomKey() {
128         return roomKey;
129     }
130
131     /**
132      * Gets the associated room name.
133      *
134      * @return the room name
135      */
136     @Nullable
137     public String getRoomName() {
138         return roomName;
139     }
140
141     /**
142      * Gets the associated scenario key.
143      *
144      * @return the scenario key
145      */
146     @Nullable
147     public String getScenarioKey() {
148         return scenarioKey;
149     }
150
151     /**
152      * Checks if the recipe is hidden
153      *
154      * @return true, if is hidden recipe
155      */
156     public boolean isHiddenRecipe() {
157         return isHiddenRecipe;
158     }
159
160     /**
161      * Checks if its a custom recipe
162      *
163      * @return true, if is custom
164      */
165     public boolean isCustom() {
166         return isCustom;
167     }
168
169     @Override
170     public String toString() {
171         return "NeeoRecipe [key=" + key + ", type=" + type + ", name=" + name + ", enabled=" + enabled + ", dirty="
172                 + dirty + ", roomKey=" + roomKey + ", roomName=" + roomName + ", scenarioKey=" + scenarioKey
173                 + ", isHiddenRecipe=" + isHiddenRecipe + ", isCustom=" + isCustom + "]";
174     }
175 }