]> git.basschouten.com Git - openhab-addons.git/blob
6ed6eada82944149a1a9adc4c76219a7cecce4af
[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.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 @Nullable String findEntityId() {
44             SmartHomeGroupIdentifier applianceGroupIdentifier = this.applianceGroupIdentifier;
45             if (applianceGroupIdentifier == null) {
46                 return null;
47             }
48             String value = applianceGroupIdentifier.value;
49             if (value == null) {
50                 return null;
51             }
52             return value;
53         }
54
55         @Override
56         public boolean isGroup() {
57             return true;
58         }
59
60         public @Nullable String applianceGroupName;
61         public @Nullable Boolean isSpace;
62         public @Nullable Boolean space;
63         public @Nullable SmartHomeGroupIdentifier applianceGroupIdentifier;
64
65         @Override
66         public String toString() {
67             return "SmartHomeGroup{" + "applianceGroupName='" + applianceGroupName + '\'' + ", isSpace=" + isSpace
68                     + ", space=" + space + ", applianceGroupIdentifier=" + applianceGroupIdentifier + '}';
69         }
70     }
71
72     public @Nullable List<SmartHomeGroup> groups;
73 }