]> git.basschouten.com Git - openhab-addons.git/blob
862ca7c99c60e241a98a900aa82139d00ad94daa
[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.amazonechocontrol.internal.jsons;
14
15 import java.util.List;
16 import java.util.Objects;
17 import java.util.Set;
18
19 import org.eclipse.jdt.annotation.NonNullByDefault;
20 import org.eclipse.jdt.annotation.Nullable;
21
22 /**
23  * The {@link JsonDevices} encapsulate the GSON data of device list
24  *
25  * @author Michael Geramb - Initial contribution
26  */
27 @NonNullByDefault
28 public class JsonDevices {
29
30     public static class Device {
31         public @Nullable String accountName;
32         public @Nullable String serialNumber;
33         public @Nullable String deviceOwnerCustomerId;
34         public @Nullable String deviceAccountId;
35         public @Nullable String deviceFamily;
36         public @Nullable String deviceType;
37         public @Nullable String softwareVersion;
38         public boolean online;
39         public @Nullable Set<String> capabilities;
40
41         public Set<String> getCapabilities() {
42             return Objects.requireNonNullElse(capabilities, Set.of());
43         }
44
45         @Override
46         public String toString() {
47             return "Device{" + "accountName='" + accountName + '\'' + ", serialNumber='" + serialNumber + '\''
48                     + ", deviceOwnerCustomerId='" + deviceOwnerCustomerId + '\'' + ", deviceAccountId='"
49                     + deviceAccountId + '\'' + ", deviceFamily='" + deviceFamily + '\'' + ", deviceType='" + deviceType
50                     + '\'' + ", softwareVersion='" + softwareVersion + '\'' + ", online=" + online + ", capabilities="
51                     + capabilities + '}';
52         }
53     }
54
55     public List<Device> devices = List.of();
56 }