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 org.apache.commons.lang.StringUtils;
16 import org.eclipse.jdt.annotation.NonNullByDefault;
17 import org.eclipse.jdt.annotation.Nullable;
18 import org.openhab.binding.amazonechocontrol.internal.jsons.JsonDevices.Device;
21 * The {@link JsonBluetoothStates} encapsulate the GSON data of bluetooth state
23 * @author Michael Geramb - Initial contribution
26 public class JsonBluetoothStates {
28 public @Nullable BluetoothState findStateByDevice(@Nullable Device device) {
33 BluetoothState @Nullable [] bluetoothStates = this.bluetoothStates;
34 if (bluetoothStates == null) {
37 for (BluetoothState state : bluetoothStates) {
38 if (state != null && StringUtils.equals(state.deviceSerialNumber, device.serialNumber)) {
45 public @Nullable BluetoothState @Nullable [] bluetoothStates;
47 public static class PairedDevice {
48 public @Nullable String address;
49 public boolean connected;
50 public @Nullable String deviceClass;
51 public @Nullable String friendlyName;
52 public @Nullable String @Nullable [] profiles;
55 public static class BluetoothState {
56 public @Nullable String deviceSerialNumber;
57 public @Nullable String deviceType;
58 public @Nullable String friendlyName;
59 public boolean gadgetPaired;
60 public boolean online;
61 public @Nullable PairedDevice @Nullable [] pairedDeviceList;