2 * Copyright (c) 2010-2020 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.amazonechocontrol.internal.jsons;
15 import java.util.Objects;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19 import org.openhab.binding.amazonechocontrol.internal.jsons.JsonDevices.Device;
22 * The {@link JsonBluetoothStates} encapsulate the GSON data of bluetooth state
24 * @author Michael Geramb - Initial contribution
27 public class JsonBluetoothStates {
29 public @Nullable BluetoothState findStateByDevice(@Nullable Device device) {
34 BluetoothState @Nullable [] bluetoothStates = this.bluetoothStates;
35 if (bluetoothStates == null) {
38 for (BluetoothState state : bluetoothStates) {
39 if (state != null && Objects.equals(state.deviceSerialNumber, device.serialNumber)) {
46 public @Nullable BluetoothState @Nullable [] bluetoothStates;
48 public static class PairedDevice {
49 public @Nullable String address;
50 public boolean connected;
51 public @Nullable String deviceClass;
52 public @Nullable String friendlyName;
53 public @Nullable String @Nullable [] profiles;
56 public static class BluetoothState {
57 public @Nullable String deviceSerialNumber;
58 public @Nullable String deviceType;
59 public @Nullable String friendlyName;
60 public boolean gadgetPaired;
61 public boolean online;
62 public @Nullable PairedDevice @Nullable [] pairedDeviceList;