2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.neeo.internal.models;
15 import java.util.Arrays;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
21 * The model representing a Neeo Scenario (serialize/deserialize json use only).
23 * @author Tim Roberts - Initial contribution
26 public class NeeoScenario {
28 /** The scenario name */
32 /** The main device key */
34 private String mainDeviceKey;
36 /** The volume device key */
38 private String volumeDeviceKey;
40 /** The scenario key */
44 /** Whether the scenario is pending configuration */
45 private boolean configured;
47 /** The associated room key */
49 private String roomKey;
51 /** The associated room name */
53 private String roomName;
55 /** The devices that make up the scenario */
56 private String @Nullable [] devices;
58 // may be used in the future
59 // private final NeeoShortcut[] shortcuts;
60 // @Nullable private String[] deviceInputMacroNames;
61 // private final NeeoCapability[] capabilities;
64 * Gets the scenario name
69 public String getName() {
74 * Gets the main device key
76 * @return the main device key
79 public String getMainDeviceKey() {
84 * Gets the volume device key
86 * @return the volume device key
89 public String getVolumeDeviceKey() {
90 return volumeDeviceKey;
94 * Gets the scenario key
99 public String getKey() {
104 * Checks if the scenario is pending configuration
106 * @return true, if is configured
108 public boolean isConfigured() {
113 * Gets the associated room key
115 * @return the room key
118 public String getRoomKey() {
123 * Gets the associated room name
125 * @return the room name
128 public String getRoomName() {
135 * @return the devices
138 public String[] getDevices() {
139 final String @Nullable [] localDevices = devices;
140 return localDevices == null ? new String[0] : localDevices;
144 public String toString() {
145 return "NeeoScenario [name=" + name + ", mainDeviceKey=" + mainDeviceKey + ", volumeDeviceKey="
146 + volumeDeviceKey + ", key=" + key + ", configured=" + configured + ", roomKey=" + roomKey
147 + ", roomName=" + roomName + ", devices=" + Arrays.toString(devices) + "]";