]> git.basschouten.com Git - openhab-addons.git/blob
87fb838718505ffa173baf550f545bb892e84464
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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.amazonechocontrol.internal.jsons;
14
15 import java.util.List;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.binding.amazonechocontrol.internal.jsons.JsonSmartHomeGroupIdentifiers.SmartHomeGroupIdentifier;
20
21 /**
22  * @author Lukas Knoeller - Initial contribution
23  */
24 @NonNullByDefault
25 public class JsonSmartHomeGroups {
26
27     public static class SmartHomeGroup implements SmartHomeBaseDevice {
28
29         @Override
30         public @Nullable String findId() {
31             SmartHomeGroupIdentifier applianceGroupIdentifier = this.applianceGroupIdentifier;
32             if (applianceGroupIdentifier == null) {
33                 return null;
34             }
35             String value = applianceGroupIdentifier.value;
36             if (value == null) {
37                 return null;
38             }
39             return value;
40         }
41
42         @Override
43         public boolean isGroup() {
44             return true;
45         }
46
47         public @Nullable String applianceGroupName;
48         public @Nullable Boolean isSpace;
49         public @Nullable Boolean space;
50         public @Nullable SmartHomeGroupIdentifier applianceGroupIdentifier;
51
52         @Override
53         public String toString() {
54             return "SmartHomeGroup{" + "applianceGroupName='" + applianceGroupName + '\'' + ", isSpace=" + isSpace
55                     + ", space=" + space + ", applianceGroupIdentifier=" + applianceGroupIdentifier + '}';
56         }
57     }
58
59     public @Nullable List<SmartHomeGroup> groups;
60 }