From ca09f71a6c4eec63ffdce63292c490f2d58f84f8 Mon Sep 17 00:00:00 2001 From: lsiepel Date: Sun, 5 Mar 2023 21:29:10 +0100 Subject: [PATCH] [bluetooth.bluegiga] Refactored and added null annotations (#13974) * All SAT warnings Signed-off-by: Leo Siepel --- .../BlueGigaBluetoothCharacteristic.java | 2 + .../bluegiga/BlueGigaBluetoothDevice.java | 17 +- .../handler/BlueGigaBridgeHandler.java | 34 ++-- .../internal/BlueGigaResponsePackets.java | 145 +++++++++--------- .../internal/BlueGigaTransactionManager.java | 17 +- .../BlueGigaAttributeValueEvent.java | 4 +- .../BlueGigaAttributeWriteCommand.java | 4 +- .../BlueGigaAttributeWriteResponse.java | 4 +- .../BlueGigaExecuteWriteCommand.java | 4 +- .../BlueGigaExecuteWriteResponse.java | 4 +- .../BlueGigaFindByTypeValueCommand.java | 4 +- .../BlueGigaFindByTypeValueResponse.java | 4 +- .../BlueGigaFindInformationCommand.java | 4 +- .../BlueGigaFindInformationFoundEvent.java | 4 +- .../BlueGigaFindInformationResponse.java | 4 +- .../BlueGigaGroupFoundEvent.java | 4 +- .../BlueGigaIndicateConfirmCommand.java | 4 +- .../BlueGigaIndicateConfirmResponse.java | 4 +- .../BlueGigaIndicatedEvent.java | 4 +- .../BlueGigaPrepareWriteCommand.java | 4 +- .../BlueGigaPrepareWriteResponse.java | 4 +- .../BlueGigaProcedureCompletedEvent.java | 4 +- .../BlueGigaReadByGroupTypeCommand.java | 4 +- .../BlueGigaReadByGroupTypeResponse.java | 4 +- .../BlueGigaReadByHandleCommand.java | 4 +- .../BlueGigaReadByHandleResponse.java | 4 +- .../BlueGigaReadByTypeCommand.java | 4 +- .../BlueGigaReadByTypeResponse.java | 4 +- .../BlueGigaReadLongCommand.java | 4 +- .../BlueGigaReadLongResponse.java | 4 +- .../BlueGigaReadMultipleCommand.java | 4 +- .../BlueGigaReadMultipleResponse.java | 4 +- .../BlueGigaReadMultipleResponseEvent.java | 4 +- .../BlueGigaWriteCommandCommand.java | 4 +- .../BlueGigaWriteCommandResponse.java | 4 +- .../BlueGigaAttributeStatusEvent.java | 4 +- .../attributedb/BlueGigaReadCommand.java | 4 +- .../attributedb/BlueGigaReadResponse.java | 4 +- .../attributedb/BlueGigaReadTypeCommand.java | 4 +- .../attributedb/BlueGigaReadTypeResponse.java | 4 +- .../BlueGigaSendAttributesCommand.java | 4 +- .../BlueGigaSendAttributesResponse.java | 4 +- .../BlueGigaUserReadRequestEvent.java | 4 +- .../BlueGigaUserReadResponseCommand.java | 4 +- .../BlueGigaUserReadResponseResponse.java | 4 +- .../BlueGigaUserWriteResponseCommand.java | 4 +- .../BlueGigaUserWriteResponseResponse.java | 4 +- .../attributedb/BlueGigaValueEvent.java | 4 +- .../attributedb/BlueGigaWriteCommand.java | 4 +- .../attributedb/BlueGigaWriteResponse.java | 4 +- .../BlueGigaChannelMapGetCommand.java | 4 +- .../BlueGigaChannelMapGetResponse.java | 4 +- .../BlueGigaConnectionStatusEvent.java | 4 +- .../connection/BlueGigaDisconnectCommand.java | 4 +- .../BlueGigaDisconnectResponse.java | 4 +- .../connection/BlueGigaDisconnectedEvent.java | 4 +- .../connection/BlueGigaFeatureIndEvent.java | 4 +- .../connection/BlueGigaGetRssiCommand.java | 4 +- .../connection/BlueGigaGetRssiResponse.java | 4 +- .../connection/BlueGigaGetStatusCommand.java | 4 +- .../connection/BlueGigaGetStatusResponse.java | 4 +- .../connection/BlueGigaUpdateCommand.java | 4 +- .../connection/BlueGigaUpdateResponse.java | 4 +- .../connection/BlueGigaVersionIndEvent.java | 4 +- .../gap/BlueGigaConnectDirectCommand.java | 4 +- .../gap/BlueGigaConnectDirectResponse.java | 4 +- .../gap/BlueGigaConnectSelectiveCommand.java | 4 +- .../gap/BlueGigaConnectSelectiveResponse.java | 4 +- .../command/gap/BlueGigaDiscoverCommand.java | 4 +- .../command/gap/BlueGigaDiscoverResponse.java | 4 +- .../gap/BlueGigaEndProcedureCommand.java | 4 +- .../gap/BlueGigaEndProcedureResponse.java | 4 +- .../gap/BlueGigaScanResponseEvent.java | 4 +- .../gap/BlueGigaSetAdvDataCommand.java | 4 +- .../gap/BlueGigaSetAdvDataResponse.java | 4 +- .../gap/BlueGigaSetAdvParametersCommand.java | 4 +- .../gap/BlueGigaSetAdvParametersResponse.java | 4 +- .../command/gap/BlueGigaSetModeCommand.java | 4 +- .../command/gap/BlueGigaSetModeResponse.java | 4 +- .../gap/BlueGigaSetScanParametersCommand.java | 4 +- .../BlueGigaSetScanParametersResponse.java | 4 +- .../security/BlueGigaBondStatusEvent.java | 4 +- .../security/BlueGigaBondingFailEvent.java | 4 +- .../BlueGigaDeleteBondingCommand.java | 4 +- .../BlueGigaDeleteBondingResponse.java | 4 +- .../security/BlueGigaEncryptStartCommand.java | 4 +- .../BlueGigaEncryptStartResponse.java | 4 +- .../security/BlueGigaGetBondsCommand.java | 4 +- .../security/BlueGigaGetBondsResponse.java | 4 +- .../security/BlueGigaPassKeyCommand.java | 4 +- .../security/BlueGigaPassKeyResponse.java | 4 +- .../security/BlueGigaPasskeyDisplayEvent.java | 4 +- .../security/BlueGigaPasskeyRequestEvent.java | 4 +- .../BlueGigaSetBondableModeCommand.java | 4 +- .../BlueGigaSetBondableModeResponse.java | 4 +- .../BlueGigaSetParametersCommand.java | 4 +- .../BlueGigaSetParametersResponse.java | 4 +- .../BlueGigaWhitelistBondsCommand.java | 4 +- .../BlueGigaWhitelistBondsResponse.java | 4 +- .../system/BlueGigaAddressGetCommand.java | 4 +- .../system/BlueGigaAddressGetResponse.java | 4 +- .../command/system/BlueGigaBootEvent.java | 4 +- .../BlueGigaEndpointWatermarkRxEvent.java | 4 +- .../BlueGigaEndpointWatermarkTxEvent.java | 4 +- .../system/BlueGigaGetConnectionsCommand.java | 4 +- .../BlueGigaGetConnectionsResponse.java | 4 +- .../system/BlueGigaGetCountersCommand.java | 4 +- .../system/BlueGigaGetCountersResponse.java | 4 +- .../system/BlueGigaGetInfoCommand.java | 4 +- .../system/BlueGigaGetInfoResponse.java | 4 +- .../command/system/BlueGigaHelloCommand.java | 4 +- .../command/system/BlueGigaHelloResponse.java | 4 +- .../system/BlueGigaNoLicenseKeyEvent.java | 4 +- .../system/BlueGigaProtocolErrorEvent.java | 4 +- .../command/system/BlueGigaResetCommand.java | 4 +- .../command/system/BlueGigaResetResponse.java | 4 +- .../BlueGigaWhitelistAppendCommand.java | 4 +- .../BlueGigaWhitelistAppendResponse.java | 4 +- .../system/BlueGigaWhitelistClearCommand.java | 4 +- .../BlueGigaWhitelistClearResponse.java | 4 +- .../BlueGigaWhitelistRemoveCommand.java | 4 +- .../BlueGigaWhitelistRemoveResponse.java | 4 +- .../bluegiga/internal/eir/EirDataType.java | 23 ++- .../bluegiga/internal/eir/EirFlags.java | 24 ++- .../enumeration/AttributeChangeReason.java | 30 ++-- .../enumeration/AttributeValueType.java | 30 ++-- .../internal/enumeration/BgApiResponse.java | 30 ++-- .../enumeration/BluetoothAddressType.java | 30 ++-- .../enumeration/ConnectionStatusFlag.java | 30 ++-- .../enumeration/GapConnectableMode.java | 30 ++-- .../internal/enumeration/GapDiscoverMode.java | 30 ++-- .../enumeration/GapDiscoverableMode.java | 30 ++-- .../enumeration/ScanResponseType.java | 30 ++-- .../enumeration/SmpIoCapabilities.java | 30 ++-- .../factory/BlueGigaHandlerFactory.java | 1 - 135 files changed, 509 insertions(+), 522 deletions(-) diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaBluetoothCharacteristic.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaBluetoothCharacteristic.java index 3b070099e..e520daf1b 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaBluetoothCharacteristic.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaBluetoothCharacteristic.java @@ -14,6 +14,7 @@ package org.openhab.binding.bluetooth.bluegiga; import java.util.UUID; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.binding.bluetooth.BluetoothCharacteristic; /** @@ -25,6 +26,7 @@ import org.openhab.binding.bluetooth.BluetoothCharacteristic; * @author Connor Petty - Initial contribution * */ +@NonNullByDefault public class BlueGigaBluetoothCharacteristic extends BluetoothCharacteristic { private boolean notifying; diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaBluetoothDevice.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaBluetoothDevice.java index 23cac2753..7938f3802 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaBluetoothDevice.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/BlueGigaBluetoothDevice.java @@ -32,7 +32,6 @@ import org.openhab.binding.bluetooth.BluetoothAddress; import org.openhab.binding.bluetooth.BluetoothBindingConstants; import org.openhab.binding.bluetooth.BluetoothCharacteristic; import org.openhab.binding.bluetooth.BluetoothDescriptor; -import org.openhab.binding.bluetooth.BluetoothDevice; import org.openhab.binding.bluetooth.BluetoothException; import org.openhab.binding.bluetooth.BluetoothService; import org.openhab.binding.bluetooth.BluetoothUtils; @@ -65,7 +64,7 @@ import org.slf4j.LoggerFactory; */ @NonNullByDefault public class BlueGigaBluetoothDevice extends BaseBluetoothDevice implements BlueGigaEventListener { - private final long TIMEOUT_SEC = 60; + private static final long TIMEOUT_SEC = 60; private final Logger logger = LoggerFactory.getLogger(BlueGigaBluetoothDevice.class); @@ -548,13 +547,17 @@ public class BlueGigaBluetoothDevice extends BaseBluetoothDevice implements Blue characteristic.setService(service); handleToCharacteristic.put(handle, characteristic); } else { + @Nullable Integer chrHandle = handleToCharacteristic.floorKey(handle); if (chrHandle == null) { logger.debug("BlueGiga: Unable to find characteristic for handle {}", handle); return; } + @Nullable BlueGigaBluetoothCharacteristic characteristic = handleToCharacteristic.get(chrHandle); - characteristic.addDescriptor(new BluetoothDescriptor(characteristic, attUUID, handle)); + if (characteristic != null) { + characteristic.addDescriptor(new BluetoothDescriptor(characteristic, attUUID, handle)); + } } } @@ -749,9 +752,11 @@ public class BlueGigaBluetoothDevice extends BaseBluetoothDevice implements Blue } else { // it must be one of the descriptors we need to update UUID attUUID = handleToUUID.get(handle); - BluetoothDescriptor descriptor = characteristic.getDescriptor(attUUID); - notifyListeners(BluetoothEventType.DESCRIPTOR_UPDATED, descriptor, - BluetoothUtils.toByteArray(event.getValue())); + if (attUUID != null) { + BluetoothDescriptor descriptor = characteristic.getDescriptor(attUUID); + notifyListeners(BluetoothEventType.DESCRIPTOR_UPDATED, descriptor, + BluetoothUtils.toByteArray(event.getValue())); + } } } diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/handler/BlueGigaBridgeHandler.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/handler/BlueGigaBridgeHandler.java index 3170d6357..8443d9d2a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/handler/BlueGigaBridgeHandler.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/handler/BlueGigaBridgeHandler.java @@ -118,8 +118,8 @@ public class BlueGigaBridgeHandler extends AbstractBluetoothBridgeHandler task = initTask; + if (task != null) { + task.cancel(true); + task = null; } stop(); super.dispose(); @@ -355,8 +357,10 @@ public class BlueGigaBridgeHandler extends AbstractBluetoothBridgeHandler scanTimer = passiveScanIdleTimer; + if (scanTimer != null) { + scanTimer.cancel(true); } } @@ -367,13 +371,17 @@ public class BlueGigaBridgeHandler extends AbstractBluetoothBridgeHandler removeTask = removeInactiveDevicesTask; + if (removeTask != null) { + removeTask.cancel(true); + removeTask = null; } - if (discoveryTask != null) { - discoveryTask.cancel(true); - discoveryTask = null; + @Nullable + ScheduledFuture discoverTask = discoveryTask; + if (discoverTask != null) { + discoverTask.cancel(true); + discoverTask = null; } } diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaResponsePackets.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaResponsePackets.java index e7b97ac5c..23952c36e 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaResponsePackets.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaResponsePackets.java @@ -103,89 +103,88 @@ class BlueGigaResponsePackets { private static Logger logger = LoggerFactory.getLogger(BlueGigaResponsePackets.class); - private static final Map> packetMap = new HashMap<>(); + private static final Map> PACKETMAP = new HashMap<>(); static { - packetMap.put(Objects.hash(0x00, 0x06, true), BlueGigaProtocolErrorEvent.class); - packetMap.put(Objects.hash(0x00, 0x02, true), BlueGigaEndpointWatermarkRxEvent.class); - packetMap.put(Objects.hash(0x00, 0x03, true), BlueGigaEndpointWatermarkTxEvent.class); - packetMap.put(Objects.hash(0x00, 0x05, true), BlueGigaNoLicenseKeyEvent.class); - packetMap.put(Objects.hash(0x04, 0x05, false), BlueGigaAttributeWriteResponse.class); - packetMap.put(Objects.hash(0x04, 0x0A, false), BlueGigaExecuteWriteResponse.class); - packetMap.put(Objects.hash(0x04, 0x00, false), BlueGigaFindByTypeValueResponse.class); - packetMap.put(Objects.hash(0x04, 0x03, false), BlueGigaFindInformationResponse.class); - packetMap.put(Objects.hash(0x04, 0x07, false), BlueGigaIndicateConfirmResponse.class); - packetMap.put(Objects.hash(0x04, 0x09, false), BlueGigaPrepareWriteResponse.class); - packetMap.put(Objects.hash(0x04, 0x01, false), BlueGigaReadByGroupTypeResponse.class); - packetMap.put(Objects.hash(0x04, 0x04, false), BlueGigaReadByHandleResponse.class); - packetMap.put(Objects.hash(0x04, 0x02, false), BlueGigaReadByTypeResponse.class); - packetMap.put(Objects.hash(0x04, 0x08, false), BlueGigaReadLongResponse.class); - packetMap.put(Objects.hash(0x04, 0x0B, false), BlueGigaReadMultipleResponse.class); - packetMap.put(Objects.hash(0x04, 0x06, false), BlueGigaWriteCommandResponse.class); - packetMap.put(Objects.hash(0x04, 0x01, true), BlueGigaProcedureCompletedEvent.class); - packetMap.put(Objects.hash(0x04, 0x05, true), BlueGigaAttributeValueEvent.class); - packetMap.put(Objects.hash(0x04, 0x04, true), BlueGigaFindInformationFoundEvent.class); - packetMap.put(Objects.hash(0x04, 0x02, true), BlueGigaGroupFoundEvent.class); - packetMap.put(Objects.hash(0x04, 0x00, true), BlueGigaIndicatedEvent.class); - packetMap.put(Objects.hash(0x04, 0x00, true), BlueGigaReadMultipleResponseEvent.class); - packetMap.put(Objects.hash(0x02, 0x01, false), BlueGigaReadResponse.class); - packetMap.put(Objects.hash(0x02, 0x02, false), BlueGigaReadTypeResponse.class); - packetMap.put(Objects.hash(0x02, 0x02, false), BlueGigaSendAttributesResponse.class); - packetMap.put(Objects.hash(0x02, 0x03, false), BlueGigaUserReadResponseResponse.class); - packetMap.put(Objects.hash(0x02, 0x04, false), BlueGigaUserWriteResponseResponse.class); - packetMap.put(Objects.hash(0x02, 0x00, false), BlueGigaWriteResponse.class); - packetMap.put(Objects.hash(0x02, 0x02, true), BlueGigaAttributeStatusEvent.class); - packetMap.put(Objects.hash(0x02, 0x01, true), BlueGigaUserReadRequestEvent.class); - packetMap.put(Objects.hash(0x02, 0x00, true), BlueGigaValueEvent.class); - packetMap.put(Objects.hash(0x03, 0x04, false), BlueGigaChannelMapGetResponse.class); - packetMap.put(Objects.hash(0x03, 0x00, false), BlueGigaDisconnectResponse.class); - packetMap.put(Objects.hash(0x03, 0x01, false), BlueGigaGetRssiResponse.class); - packetMap.put(Objects.hash(0x03, 0x07, false), BlueGigaGetStatusResponse.class); - packetMap.put(Objects.hash(0x03, 0x02, false), BlueGigaUpdateResponse.class); - packetMap.put(Objects.hash(0x03, 0x04, true), BlueGigaDisconnectedEvent.class); - packetMap.put(Objects.hash(0x03, 0x02, true), BlueGigaFeatureIndEvent.class); - packetMap.put(Objects.hash(0x03, 0x00, true), BlueGigaConnectionStatusEvent.class); - packetMap.put(Objects.hash(0x03, 0x01, true), BlueGigaVersionIndEvent.class); - packetMap.put(Objects.hash(0x06, 0x07, false), BlueGigaSetScanParametersResponse.class); - packetMap.put(Objects.hash(0x06, 0x03, false), BlueGigaConnectDirectResponse.class); - packetMap.put(Objects.hash(0x06, 0x05, false), BlueGigaConnectSelectiveResponse.class); - packetMap.put(Objects.hash(0x06, 0x02, false), BlueGigaDiscoverResponse.class); - packetMap.put(Objects.hash(0x06, 0x08, false), BlueGigaSetAdvParametersResponse.class); - packetMap.put(Objects.hash(0x06, 0x09, false), BlueGigaSetAdvDataResponse.class); - packetMap.put(Objects.hash(0x06, 0x04, false), BlueGigaEndProcedureResponse.class); - packetMap.put(Objects.hash(0x06, 0x01, false), BlueGigaSetModeResponse.class); - packetMap.put(Objects.hash(0x06, 0x00, true), BlueGigaScanResponseEvent.class); - packetMap.put(Objects.hash(0x05, 0x02, false), BlueGigaDeleteBondingResponse.class); - packetMap.put(Objects.hash(0x05, 0x00, false), BlueGigaEncryptStartResponse.class); - packetMap.put(Objects.hash(0x05, 0x05, false), BlueGigaGetBondsResponse.class); - packetMap.put(Objects.hash(0x05, 0x04, false), BlueGigaPassKeyResponse.class); - packetMap.put(Objects.hash(0x05, 0x01, false), BlueGigaSetBondableModeResponse.class); - packetMap.put(Objects.hash(0x05, 0x03, false), BlueGigaSetParametersResponse.class); - packetMap.put(Objects.hash(0x05, 0x07, false), BlueGigaWhitelistBondsResponse.class); - packetMap.put(Objects.hash(0x00, 0x0A, false), BlueGigaWhitelistAppendResponse.class); - packetMap.put(Objects.hash(0x00, 0x0B, false), BlueGigaWhitelistRemoveResponse.class); - packetMap.put(Objects.hash(0x00, 0x0C, false), BlueGigaWhitelistClearResponse.class); - packetMap.put(Objects.hash(0x05, 0x01, true), BlueGigaBondingFailEvent.class); - packetMap.put(Objects.hash(0x05, 0x04, true), BlueGigaBondStatusEvent.class); - packetMap.put(Objects.hash(0x05, 0x02, true), BlueGigaPasskeyDisplayEvent.class); - packetMap.put(Objects.hash(0x05, 0x03, true), BlueGigaPasskeyRequestEvent.class); - packetMap.put(Objects.hash(0x00, 0x02, false), BlueGigaAddressGetResponse.class); - packetMap.put(Objects.hash(0x00, 0x01, false), BlueGigaHelloResponse.class); - packetMap.put(Objects.hash(0x00, 0x00, false), BlueGigaResetResponse.class); - packetMap.put(Objects.hash(0x00, 0x06, false), BlueGigaGetConnectionsResponse.class); - packetMap.put(Objects.hash(0x00, 0x05, false), BlueGigaGetCountersResponse.class); - packetMap.put(Objects.hash(0x00, 0x08, false), BlueGigaGetInfoResponse.class); - packetMap.put(Objects.hash(0x00, 0x00, true), BlueGigaBootEvent.class); + PACKETMAP.put(Objects.hash(0x00, 0x06, true), BlueGigaProtocolErrorEvent.class); + PACKETMAP.put(Objects.hash(0x00, 0x02, true), BlueGigaEndpointWatermarkRxEvent.class); + PACKETMAP.put(Objects.hash(0x00, 0x03, true), BlueGigaEndpointWatermarkTxEvent.class); + PACKETMAP.put(Objects.hash(0x00, 0x05, true), BlueGigaNoLicenseKeyEvent.class); + PACKETMAP.put(Objects.hash(0x04, 0x05, false), BlueGigaAttributeWriteResponse.class); + PACKETMAP.put(Objects.hash(0x04, 0x0A, false), BlueGigaExecuteWriteResponse.class); + PACKETMAP.put(Objects.hash(0x04, 0x00, false), BlueGigaFindByTypeValueResponse.class); + PACKETMAP.put(Objects.hash(0x04, 0x03, false), BlueGigaFindInformationResponse.class); + PACKETMAP.put(Objects.hash(0x04, 0x07, false), BlueGigaIndicateConfirmResponse.class); + PACKETMAP.put(Objects.hash(0x04, 0x09, false), BlueGigaPrepareWriteResponse.class); + PACKETMAP.put(Objects.hash(0x04, 0x01, false), BlueGigaReadByGroupTypeResponse.class); + PACKETMAP.put(Objects.hash(0x04, 0x04, false), BlueGigaReadByHandleResponse.class); + PACKETMAP.put(Objects.hash(0x04, 0x02, false), BlueGigaReadByTypeResponse.class); + PACKETMAP.put(Objects.hash(0x04, 0x08, false), BlueGigaReadLongResponse.class); + PACKETMAP.put(Objects.hash(0x04, 0x0B, false), BlueGigaReadMultipleResponse.class); + PACKETMAP.put(Objects.hash(0x04, 0x06, false), BlueGigaWriteCommandResponse.class); + PACKETMAP.put(Objects.hash(0x04, 0x01, true), BlueGigaProcedureCompletedEvent.class); + PACKETMAP.put(Objects.hash(0x04, 0x05, true), BlueGigaAttributeValueEvent.class); + PACKETMAP.put(Objects.hash(0x04, 0x04, true), BlueGigaFindInformationFoundEvent.class); + PACKETMAP.put(Objects.hash(0x04, 0x02, true), BlueGigaGroupFoundEvent.class); + PACKETMAP.put(Objects.hash(0x04, 0x00, true), BlueGigaIndicatedEvent.class); + PACKETMAP.put(Objects.hash(0x04, 0x00, true), BlueGigaReadMultipleResponseEvent.class); + PACKETMAP.put(Objects.hash(0x02, 0x01, false), BlueGigaReadResponse.class); + PACKETMAP.put(Objects.hash(0x02, 0x02, false), BlueGigaReadTypeResponse.class); + PACKETMAP.put(Objects.hash(0x02, 0x02, false), BlueGigaSendAttributesResponse.class); + PACKETMAP.put(Objects.hash(0x02, 0x03, false), BlueGigaUserReadResponseResponse.class); + PACKETMAP.put(Objects.hash(0x02, 0x04, false), BlueGigaUserWriteResponseResponse.class); + PACKETMAP.put(Objects.hash(0x02, 0x00, false), BlueGigaWriteResponse.class); + PACKETMAP.put(Objects.hash(0x02, 0x02, true), BlueGigaAttributeStatusEvent.class); + PACKETMAP.put(Objects.hash(0x02, 0x01, true), BlueGigaUserReadRequestEvent.class); + PACKETMAP.put(Objects.hash(0x02, 0x00, true), BlueGigaValueEvent.class); + PACKETMAP.put(Objects.hash(0x03, 0x04, false), BlueGigaChannelMapGetResponse.class); + PACKETMAP.put(Objects.hash(0x03, 0x00, false), BlueGigaDisconnectResponse.class); + PACKETMAP.put(Objects.hash(0x03, 0x01, false), BlueGigaGetRssiResponse.class); + PACKETMAP.put(Objects.hash(0x03, 0x07, false), BlueGigaGetStatusResponse.class); + PACKETMAP.put(Objects.hash(0x03, 0x02, false), BlueGigaUpdateResponse.class); + PACKETMAP.put(Objects.hash(0x03, 0x04, true), BlueGigaDisconnectedEvent.class); + PACKETMAP.put(Objects.hash(0x03, 0x02, true), BlueGigaFeatureIndEvent.class); + PACKETMAP.put(Objects.hash(0x03, 0x00, true), BlueGigaConnectionStatusEvent.class); + PACKETMAP.put(Objects.hash(0x03, 0x01, true), BlueGigaVersionIndEvent.class); + PACKETMAP.put(Objects.hash(0x06, 0x07, false), BlueGigaSetScanParametersResponse.class); + PACKETMAP.put(Objects.hash(0x06, 0x03, false), BlueGigaConnectDirectResponse.class); + PACKETMAP.put(Objects.hash(0x06, 0x05, false), BlueGigaConnectSelectiveResponse.class); + PACKETMAP.put(Objects.hash(0x06, 0x02, false), BlueGigaDiscoverResponse.class); + PACKETMAP.put(Objects.hash(0x06, 0x08, false), BlueGigaSetAdvParametersResponse.class); + PACKETMAP.put(Objects.hash(0x06, 0x09, false), BlueGigaSetAdvDataResponse.class); + PACKETMAP.put(Objects.hash(0x06, 0x04, false), BlueGigaEndProcedureResponse.class); + PACKETMAP.put(Objects.hash(0x06, 0x01, false), BlueGigaSetModeResponse.class); + PACKETMAP.put(Objects.hash(0x06, 0x00, true), BlueGigaScanResponseEvent.class); + PACKETMAP.put(Objects.hash(0x05, 0x02, false), BlueGigaDeleteBondingResponse.class); + PACKETMAP.put(Objects.hash(0x05, 0x00, false), BlueGigaEncryptStartResponse.class); + PACKETMAP.put(Objects.hash(0x05, 0x05, false), BlueGigaGetBondsResponse.class); + PACKETMAP.put(Objects.hash(0x05, 0x04, false), BlueGigaPassKeyResponse.class); + PACKETMAP.put(Objects.hash(0x05, 0x01, false), BlueGigaSetBondableModeResponse.class); + PACKETMAP.put(Objects.hash(0x05, 0x03, false), BlueGigaSetParametersResponse.class); + PACKETMAP.put(Objects.hash(0x05, 0x07, false), BlueGigaWhitelistBondsResponse.class); + PACKETMAP.put(Objects.hash(0x00, 0x0A, false), BlueGigaWhitelistAppendResponse.class); + PACKETMAP.put(Objects.hash(0x00, 0x0B, false), BlueGigaWhitelistRemoveResponse.class); + PACKETMAP.put(Objects.hash(0x00, 0x0C, false), BlueGigaWhitelistClearResponse.class); + PACKETMAP.put(Objects.hash(0x05, 0x01, true), BlueGigaBondingFailEvent.class); + PACKETMAP.put(Objects.hash(0x05, 0x04, true), BlueGigaBondStatusEvent.class); + PACKETMAP.put(Objects.hash(0x05, 0x02, true), BlueGigaPasskeyDisplayEvent.class); + PACKETMAP.put(Objects.hash(0x05, 0x03, true), BlueGigaPasskeyRequestEvent.class); + PACKETMAP.put(Objects.hash(0x00, 0x02, false), BlueGigaAddressGetResponse.class); + PACKETMAP.put(Objects.hash(0x00, 0x01, false), BlueGigaHelloResponse.class); + PACKETMAP.put(Objects.hash(0x00, 0x00, false), BlueGigaResetResponse.class); + PACKETMAP.put(Objects.hash(0x00, 0x06, false), BlueGigaGetConnectionsResponse.class); + PACKETMAP.put(Objects.hash(0x00, 0x05, false), BlueGigaGetCountersResponse.class); + PACKETMAP.put(Objects.hash(0x00, 0x08, false), BlueGigaGetInfoResponse.class); + PACKETMAP.put(Objects.hash(0x00, 0x00, true), BlueGigaBootEvent.class); } - @SuppressWarnings({ "null", "unused" }) @Nullable public static BlueGigaResponse getPacket(int[] data) { int cmdClass = data[2]; int cmdMethod = data[3]; boolean isEvent = (data[0] & 0x80) != 0; - Class bleClass = packetMap.get(Objects.hash(cmdClass, cmdMethod, isEvent)); + Class bleClass = PACKETMAP.get(Objects.hash(cmdClass, cmdMethod, isEvent)); if (bleClass == null) { return null; diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaTransactionManager.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaTransactionManager.java index 60d440473..ef4204d0c 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaTransactionManager.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/BlueGigaTransactionManager.java @@ -105,9 +105,11 @@ public class BlueGigaTransactionManager implements BlueGigaSerialEventListener { } private void cancelTransactionTimer() { - if (transactionTimeoutTimer != null) { - transactionTimeoutTimer.cancel(true); - transactionTimeoutTimer = null; + @Nullable + Future transTimer = transactionTimeoutTimer; + if (transTimer != null) { + transTimer.cancel(true); + transTimer = null; } } @@ -121,17 +123,12 @@ public class BlueGigaTransactionManager implements BlueGigaSerialEventListener { }); } - @SuppressWarnings({ "null", "unused" }) private Optional getNextFrame() { while (!sendQueue.isEmpty()) { + @Nullable BlueGigaUniqueCommand frame = sendQueue.poll(); if (frame != null) { - if (frame.getMessage() != null) { - return Optional.of(frame); - } else { - logger.debug("Null message found from queue, skip it"); - continue; - } + return Optional.of(frame); } else { logger.debug("Null frame found from queue, skip it"); continue; diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeValueEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeValueEvent.java index a4e3a8325..48c5f3ecb 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeValueEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeValueEvent.java @@ -31,8 +31,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.AttributeValu */ @NonNullByDefault public class BlueGigaAttributeValueEvent extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x05; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x05; /** * Attribute handle diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteCommand.java index 8b64130e6..ca2804686 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteCommand.java @@ -31,8 +31,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaAttributeWriteCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x05; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x05; private BlueGigaAttributeWriteCommand(CommandBuilder builder) { super.setConnection(builder.connection); diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteResponse.java index ad5142bfb..7c5cf181a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaAttributeWriteResponse.java @@ -31,8 +31,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaAttributeWriteResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x05; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x05; /** * 0 : write was successful. Otherwise error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteCommand.java index ddd00a02c..ee37dfd83 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteCommand.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaExecuteWriteCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x0A; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x0A; /** * 1: commits queued writes, 0: cancels queued writes diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteResponse.java index 11bfad718..70f1d1a3f 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaExecuteWriteResponse.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaExecuteWriteResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x0A; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x0A; /** * 0 : write was successful. Otherwise error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueCommand.java index 613b098bf..51d80da45 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueCommand.java @@ -31,8 +31,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaFindByTypeValueCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x00; /** * First requested handle number diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueResponse.java index b16889c64..2181e86bb 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindByTypeValueResponse.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaFindByTypeValueResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x00; /** * 0 : the operation was successful. Otherwise error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationCommand.java index c8a90b72c..c43cf21a2 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationCommand.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaFindInformationCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x03; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x03; private BlueGigaFindInformationCommand(CommandBuilder builder) { super.setConnection(builder.connection); diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationFoundEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationFoundEvent.java index bbe2b5f44..872e88560 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationFoundEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationFoundEvent.java @@ -32,8 +32,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceResponse; */ @NonNullByDefault public class BlueGigaFindInformationFoundEvent extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x04; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x04; /** * Characteristics handle diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationResponse.java index 3c46831ca..c83ad8866 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaFindInformationResponse.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaFindInformationResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x03; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x03; /** * 0 : the operation was successful. Otherwise error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaGroupFoundEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaGroupFoundEvent.java index 6f4c4d289..7421043ec 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaGroupFoundEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaGroupFoundEvent.java @@ -31,8 +31,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceResponse; */ @NonNullByDefault public class BlueGigaGroupFoundEvent extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x02; /** * Starting handle diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmCommand.java index e2ea46178..36f3328cf 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmCommand.java @@ -32,8 +32,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaIndicateConfirmCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x07; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x07; @Override public int[] serialize() { diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmResponse.java index 851cf441d..5fdd3f8ff 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicateConfirmResponse.java @@ -33,8 +33,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaIndicateConfirmResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x07; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x07; /** * Command result. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicatedEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicatedEvent.java index 12d5e8fe8..1d28ff40d 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicatedEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaIndicatedEvent.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceResponse; */ @NonNullByDefault public class BlueGigaIndicatedEvent extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x00; /** * Attribute handle diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteCommand.java index 6d8e2fb3a..263708505 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteCommand.java @@ -32,8 +32,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaPrepareWriteCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x09; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x09; /** * Attribute handle diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteResponse.java index 38bf919e5..d5a4957bf 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaPrepareWriteResponse.java @@ -33,8 +33,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaPrepareWriteResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x09; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x09; /** * Command result. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaProcedureCompletedEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaProcedureCompletedEvent.java index fe543aa58..e4f381629 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaProcedureCompletedEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaProcedureCompletedEvent.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaProcedureCompletedEvent extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x01; /** * 0: The operation was successful. Otherwise: attribute protocol error code returned by diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeCommand.java index 6d8a3e17e..4274e2e9c 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeCommand.java @@ -34,8 +34,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaReadByGroupTypeCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x01; private BlueGigaReadByGroupTypeCommand(CommandBuilder builder) { super.setConnection(builder.connection); diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeResponse.java index 33651b03e..ba5129b8c 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByGroupTypeResponse.java @@ -32,8 +32,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaReadByGroupTypeResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x01; /** * Command result. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleCommand.java index 9bdd4a989..707695506 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleCommand.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaReadByHandleCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x04; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x04; private BlueGigaReadByHandleCommand(CommandBuilder builder) { super.setConnection(builder.connection); diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleResponse.java index abf207725..4a69961a6 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByHandleResponse.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaReadByHandleResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x04; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x04; /** * 0 : the command was successful. Otherwise an error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeCommand.java index e2875c9fb..a77ace5ae 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeCommand.java @@ -32,8 +32,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaReadByTypeCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x02; /** * First attribute handle diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeResponse.java index 1dd8da833..593f6541a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadByTypeResponse.java @@ -31,8 +31,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaReadByTypeResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x02; /** * 0 : the command was successful. Otherwise an error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongCommand.java index 5e17a7fdb..e919f9857 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongCommand.java @@ -32,8 +32,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaReadLongCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x08; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x08; /** * Attribute handle diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongResponse.java index f37f3715f..c94fbb437 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadLongResponse.java @@ -33,8 +33,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaReadLongResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x08; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x08; /** * 0 : the command was successful. Otherwise an error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleCommand.java index 796732308..fc39436cd 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleCommand.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaReadMultipleCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x0B; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x0B; /** * List of attribute handles to read from the remote device diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponse.java index 8e23a0784..fb2d9cea6 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponse.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaReadMultipleResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x0B; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x0B; /** * 0 : the command was successful. Otherwise an error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponseEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponseEvent.java index 78d782eb4..b8404e8ea 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponseEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaReadMultipleResponseEvent.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceResponse; */ @NonNullByDefault public class BlueGigaReadMultipleResponseEvent extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x00; /** * This array contains the concatenated data from the multiple attributes that have been read, diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandCommand.java index 96f334196..4f545b5f7 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandCommand.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaWriteCommandCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x06; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x06; /** * Attribute handle to write diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandResponse.java index 4375834b6..58e1d6524 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributeclient/BlueGigaWriteCommandResponse.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaWriteCommandResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x04; - public static int COMMAND_METHOD = 0x06; + public static final int COMMAND_CLASS = 0x04; + public static final int COMMAND_METHOD = 0x06; /** * 0 : the command was successful. Otherwise an error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaAttributeStatusEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaAttributeStatusEvent.java index 7aee2dc08..5b2d1c2cd 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaAttributeStatusEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaAttributeStatusEvent.java @@ -31,8 +31,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaAttributeStatusEvent extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x02; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x02; + public static final int COMMAND_METHOD = 0x02; /** * Attribute handle diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadCommand.java index 68b7d09a3..996f56e04 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadCommand.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaReadCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x02; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x02; + public static final int COMMAND_METHOD = 0x01; /** * Handle of the attribute to read diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadResponse.java index 8d019e502..d54c77130 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadResponse.java @@ -31,8 +31,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaReadResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x02; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x02; + public static final int COMMAND_METHOD = 0x01; /** * Handle of the attribute which was read diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeCommand.java index 8d1d38091..c60a06167 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeCommand.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaReadTypeCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x02; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x02; + public static final int COMMAND_METHOD = 0x02; /** * Handle of the attribute to read diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeResponse.java index 35238f513..abf10bc9a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaReadTypeResponse.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaReadTypeResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x02; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x02; + public static final int COMMAND_METHOD = 0x02; /** * Handle of the attribute which was read diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesCommand.java index 552d5b978..72a7ecbc4 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesCommand.java @@ -32,8 +32,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaSendAttributesCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x02; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x02; + public static final int COMMAND_METHOD = 0x02; /** * Attribute handle to send. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesResponse.java index df6681005..f4d0f19b3 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaSendAttributesResponse.java @@ -33,8 +33,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaSendAttributesResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x02; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x02; + public static final int COMMAND_METHOD = 0x02; /** * 0 : the command was successful. Otherwise an error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadRequestEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadRequestEvent.java index 2476960a3..0895283da 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadRequestEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadRequestEvent.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceResponse; */ @NonNullByDefault public class BlueGigaUserReadRequestEvent extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x02; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x02; + public static final int COMMAND_METHOD = 0x01; /** * Attribute handle requested diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseCommand.java index 88236e75f..da58a47d8 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseCommand.java @@ -35,8 +35,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaUserReadResponseCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x02; - public static int COMMAND_METHOD = 0x03; + public static final int COMMAND_CLASS = 0x02; + public static final int COMMAND_METHOD = 0x03; /** * 0: User Read Request is responded with data. In case of an error an application specific error diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseResponse.java index 917dd407b..34c4c294c 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserReadResponseResponse.java @@ -35,8 +35,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaUserReadResponseResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x02; - public static int COMMAND_METHOD = 0x03; + public static final int COMMAND_CLASS = 0x02; + public static final int COMMAND_METHOD = 0x03; /** * Response constructor diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseCommand.java index 45ff9777c..5d7f98530 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseCommand.java @@ -34,8 +34,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaUserWriteResponseCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x02; - public static int COMMAND_METHOD = 0x04; + public static final int COMMAND_CLASS = 0x02; + public static final int COMMAND_METHOD = 0x04; /** * 0: User Read Request is responded with data. In case of an error an application specific error diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseResponse.java index 1f4831e77..8a2d5b747 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaUserWriteResponseResponse.java @@ -34,8 +34,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaUserWriteResponseResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x02; - public static int COMMAND_METHOD = 0x04; + public static final int COMMAND_CLASS = 0x02; + public static final int COMMAND_METHOD = 0x04; /** * Response constructor diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaValueEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaValueEvent.java index fd4282ded..936497d13 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaValueEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaValueEvent.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.AttributeChan */ @NonNullByDefault public class BlueGigaValueEvent extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x02; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x02; + public static final int COMMAND_METHOD = 0x00; /** * Reason why value has changed see: enum Attribute Change Reason diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteCommand.java index 144785da0..62f79c38f 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteCommand.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaWriteCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x02; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x02; + public static final int COMMAND_METHOD = 0x00; /** * Handle of the attribute to write. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteResponse.java index 7e4caf6d1..7ec5bbbe9 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/attributedb/BlueGigaWriteResponse.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaWriteResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x02; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x02; + public static final int COMMAND_METHOD = 0x00; /** * 0: the write was successful. Non-zero: An error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetCommand.java index 6ae89f799..3d45f48ea 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetCommand.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaChannelMapGetCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x03; - public static int COMMAND_METHOD = 0x04; + public static final int COMMAND_CLASS = 0x03; + public static final int COMMAND_METHOD = 0x04; @Override public int[] serialize() { diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetResponse.java index a430d4cac..d053ebe5b 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaChannelMapGetResponse.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceResponse; */ @NonNullByDefault public class BlueGigaChannelMapGetResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x03; - public static int COMMAND_METHOD = 0x04; + public static final int COMMAND_CLASS = 0x03; + public static final int COMMAND_METHOD = 0x04; /** * Current Channel Map. Each bit corresponds to one channel. 0-bit corresponds to 0 channel. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaConnectionStatusEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaConnectionStatusEvent.java index f5d85267f..c4dbeab43 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaConnectionStatusEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaConnectionStatusEvent.java @@ -33,8 +33,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.ConnectionSta */ @NonNullByDefault public class BlueGigaConnectionStatusEvent extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x03; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x03; + public static final int COMMAND_METHOD = 0x00; /** * Connection status flags use connstatus-enumerator diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectCommand.java index 37e53bd3b..8a6962803 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectCommand.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaDisconnectCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x03; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x03; + public static final int COMMAND_METHOD = 0x00; private BlueGigaDisconnectCommand(CommandBuilder builder) { super.setConnection(builder.connection); diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectResponse.java index bea5e3cf4..32df7658d 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectResponse.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaDisconnectResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x03; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x03; + public static final int COMMAND_METHOD = 0x00; /** * 0 : the update was successful. Non-zero: An error occurred. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectedEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectedEvent.java index 76f6043e7..3c27cbad9 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectedEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaDisconnectedEvent.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaDisconnectedEvent extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x03; - public static int COMMAND_METHOD = 0x04; + public static final int COMMAND_CLASS = 0x03; + public static final int COMMAND_METHOD = 0x04; /** * Disconnection reason code. 0 : disconnected by local user diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaFeatureIndEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaFeatureIndEvent.java index 077465ea3..dd64cb03e 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaFeatureIndEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaFeatureIndEvent.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceResponse; */ @NonNullByDefault public class BlueGigaFeatureIndEvent extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x03; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x03; + public static final int COMMAND_METHOD = 0x02; /** * CtrData field from LL_FEATURE_RSP - packet diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiCommand.java index 9894e0676..febac4ca3 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiCommand.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaGetRssiCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x03; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x03; + public static final int COMMAND_METHOD = 0x01; @Override public int[] serialize() { diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiResponse.java index 3afe3bd22..faacde2bd 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetRssiResponse.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceResponse; */ @NonNullByDefault public class BlueGigaGetRssiResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x03; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x03; + public static final int COMMAND_METHOD = 0x01; /** * RSSI value of the connection in dBm. Range: -103 to -38 diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusCommand.java index cf7ba1b8e..73c38f9e7 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusCommand.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaGetStatusCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x03; - public static int COMMAND_METHOD = 0x07; + public static final int COMMAND_CLASS = 0x03; + public static final int COMMAND_METHOD = 0x07; @Override public int[] serialize() { diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusResponse.java index 15124aa77..0f8b65577 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaGetStatusResponse.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceResponse; */ @NonNullByDefault public class BlueGigaGetStatusResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x03; - public static int COMMAND_METHOD = 0x07; + public static final int COMMAND_CLASS = 0x03; + public static final int COMMAND_METHOD = 0x07; /** * Response constructor diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateCommand.java index 7402e1ad8..94e553143 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateCommand.java @@ -34,8 +34,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceCommand; */ @NonNullByDefault public class BlueGigaUpdateCommand extends BlueGigaDeviceCommand { - public static int COMMAND_CLASS = 0x03; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x03; + public static final int COMMAND_METHOD = 0x02; /** * Minimum connection interval (units of 1.25ms) diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateResponse.java index d94c0aea3..1c5f1523a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaUpdateResponse.java @@ -35,8 +35,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaUpdateResponse extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x03; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x03; + public static final int COMMAND_METHOD = 0x02; /** * 0 : the update was successful. Non-zero: An error occurred. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaVersionIndEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaVersionIndEvent.java index 1753defb0..b001c9571 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaVersionIndEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/connection/BlueGigaVersionIndEvent.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaDeviceResponse; */ @NonNullByDefault public class BlueGigaVersionIndEvent extends BlueGigaDeviceResponse { - public static int COMMAND_CLASS = 0x03; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x03; + public static final int COMMAND_METHOD = 0x01; /** * Bluetooth controller specification version diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectCommand.java index f66e31eb0..eb0d2033e 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectCommand.java @@ -40,8 +40,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BluetoothAddr */ @NonNullByDefault public class BlueGigaConnectDirectCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x03; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x03; private BlueGigaConnectDirectCommand(CommandBuilder builder) { this.address = builder.address; diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectResponse.java index 7e7106995..bea53adb0 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectDirectResponse.java @@ -39,8 +39,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaConnectDirectResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x03; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x03; /** * 0 : procedure was successfully started Non-zero: An error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveCommand.java index 700d78ea5..d6369ca87 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveCommand.java @@ -35,8 +35,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaConnectSelectiveCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x05; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x05; /** * Minimum Connection Interval (in units of 1.25ms). Range: 6 - 3200 The lowest possible diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveResponse.java index 0dc3e8802..ec49b9da0 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaConnectSelectiveResponse.java @@ -36,8 +36,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaConnectSelectiveResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x05; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x05; /** * 0 : procedure was successfully started Non-zero: An error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverCommand.java index 0c11ea0a6..884690ba6 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverCommand.java @@ -32,8 +32,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.GapDiscoverMo */ @NonNullByDefault public class BlueGigaDiscoverCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x02; private BlueGigaDiscoverCommand(CommandBuilder builder) { this.mode = builder.mode; diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverResponse.java index afcc3f4e9..8f67be8b2 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaDiscoverResponse.java @@ -32,8 +32,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaDiscoverResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x02; /** * 0: Scan procedure was successfully started Non-zero: An error occurred. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureCommand.java index d96dcdf42..53e4f200d 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureCommand.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaEndProcedureCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x04; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x04; @Override public int[] serialize() { diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureResponse.java index e65b835f1..d69d5136c 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaEndProcedureResponse.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaEndProcedureResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x04; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x04; /** * 0: the command was successful. Non-zero: An error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaScanResponseEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaScanResponseEvent.java index 0d39203a9..c96ebfbe1 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaScanResponseEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaScanResponseEvent.java @@ -31,8 +31,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.ScanResponseT */ @NonNullByDefault public class BlueGigaScanResponseEvent extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x00; /** * RSSI value (dBm). Range: -103 to -38 diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataCommand.java index 4ec575341..65b36d75a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataCommand.java @@ -33,8 +33,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaSetAdvDataCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x09; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x09; /** * Advertisement data type. 0 : sets advertisement data. 1 : sets scan response data diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataResponse.java index 3ce6c1c71..b71015117 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvDataResponse.java @@ -34,8 +34,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaSetAdvDataResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x09; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x09; /** * 0: Command was successfully executed. Non-zero: An error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersCommand.java index f8fcf057a..fcb1f2689 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersCommand.java @@ -31,8 +31,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaSetAdvParametersCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x08; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x08; /** * Minimum advertisement interval in units of 625us. Range: 0x20 to 0x4000. Default: 0x200 diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersResponse.java index 29c7fa563..cfa2ed64e 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetAdvParametersResponse.java @@ -32,8 +32,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaSetAdvParametersResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x08; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x08; /** * 0: Command was successfully executed. Non-zero: An error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeCommand.java index 5c2e2a2b9..028792b9c 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeCommand.java @@ -33,8 +33,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.GapDiscoverab */ @NonNullByDefault public class BlueGigaSetModeCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x01; private BlueGigaSetModeCommand(CommandBuilder builder) { this.discover = builder.discover; diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeResponse.java index ee3a6012e..15cf560c0 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetModeResponse.java @@ -31,8 +31,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaSetModeResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x01; /** * 0: the command was successful. Non-zero: An error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersCommand.java index 0c0a5f294..185826d95 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersCommand.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaSetScanParametersCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x07; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x07; private BlueGigaSetScanParametersCommand(CommandBuilder builder) { this.scanInterval = builder.scanInterval; diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersResponse.java index b4d3b51de..f024d8b31 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/gap/BlueGigaSetScanParametersResponse.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaSetScanParametersResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x06; - public static int COMMAND_METHOD = 0x07; + public static final int COMMAND_CLASS = 0x06; + public static final int COMMAND_METHOD = 0x07; /** * 0: The command was executed successfully. Non-zero: An error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondStatusEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondStatusEvent.java index b8b7e65a8..af3d1c138 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondStatusEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondStatusEvent.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaBondStatusEvent extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x04; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x04; /** * Bonding handle diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondingFailEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondingFailEvent.java index 976492bb1..d98301768 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondingFailEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaBondingFailEvent.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaBondingFailEvent extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x01; /** * Connection handle diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingCommand.java index 37dc947ca..15ddd358b 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingCommand.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaDeleteBondingCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x02; /** * Bonding handle of a device. This handle can be obtained for example from events like: Scan diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingResponse.java index cdce545e5..a4f410c1b 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaDeleteBondingResponse.java @@ -31,8 +31,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaDeleteBondingResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x02; /** * 0: the command was successful. Non-zero: An error occurred diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartCommand.java index 18b09d609..ed60b6a0d 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartCommand.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaEncryptStartCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x00; /** * Bonding handle of a device. This handle can be obtained for example from events like: Scan diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartResponse.java index ab91d33a8..dac701d77 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaEncryptStartResponse.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaEncryptStartResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x00; /** * Connection handle diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsCommand.java index be36b9440..2eaf7a549 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsCommand.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaGetBondsCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x05; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x05; @Override public int[] serialize() { diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsResponse.java index 6943941e3..97b2dcb2c 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaGetBondsResponse.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaGetBondsResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x05; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x05; /** * Num of currently bonded devices diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyCommand.java index f7d7f301b..32c7794c4 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyCommand.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaPassKeyCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x04; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x04; /** * Connection handle diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyResponse.java index e3a29a5de..f6924a776 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPassKeyResponse.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaPassKeyResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x04; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x04; /** * Command Result diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyDisplayEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyDisplayEvent.java index a47e9511f..ec95a5b0a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyDisplayEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyDisplayEvent.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaPasskeyDisplayEvent extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x02; /** * Bluetooth connection handle diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyRequestEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyRequestEvent.java index c98d36004..08864d317 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyRequestEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaPasskeyRequestEvent.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaPasskeyRequestEvent extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x03; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x03; /** * Bluetooth connection handle diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeCommand.java index 1f5321dbf..37da5b404 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeCommand.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaSetBondableModeCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x01; /** * Enables or disables bonding mode. 0 : the device is not bondable. 1 : the device is bondable diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeResponse.java index e9d970ab6..399ecded2 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetBondableModeResponse.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaSetBondableModeResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x01; /** * Response constructor diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersCommand.java index 25c06d7c4..8fa299fdf 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersCommand.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.SmpIoCapabili */ @NonNullByDefault public class BlueGigaSetParametersCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x03; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x03; /** * 1: Man-in-the-middle protection required. 0: No Man-in-the-middle protection. Default: diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersResponse.java index f3712770a..bf7747b6e 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaSetParametersResponse.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaSetParametersResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x03; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x03; /** * Response constructor diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsCommand.java index d86259afe..ba3abecb3 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsCommand.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaWhitelistBondsCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x07; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x07; @Override public int[] serialize() { diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsResponse.java index c1c991d24..ee79d20d0 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/security/BlueGigaWhitelistBondsResponse.java @@ -31,8 +31,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaWhitelistBondsResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x05; - public static int COMMAND_METHOD = 0x07; + public static final int COMMAND_CLASS = 0x05; + public static final int COMMAND_METHOD = 0x07; /** * Command result diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetCommand.java index 378019aac..db7551db2 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetCommand.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaAddressGetCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x02; @Override public int[] serialize() { diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetResponse.java index dc58330ff..338f43736 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaAddressGetResponse.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaAddressGetResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x02; /** * Bluetooth address of the local device diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaBootEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaBootEvent.java index 5904da364..054befd67 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaBootEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaBootEvent.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaBootEvent extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x00; /** * Major software version diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkRxEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkRxEvent.java index e841ca0aa..bd5e37f16 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkRxEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkRxEvent.java @@ -31,8 +31,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaEndpointWatermarkRxEvent extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x02; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x02; /** * Endpoint index where data was received diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkTxEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkTxEvent.java index e18c46dfd..c5d8da7d2 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkTxEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaEndpointWatermarkTxEvent.java @@ -31,8 +31,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaEndpointWatermarkTxEvent extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x03; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x03; /** * Endpoint index where data was sent diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsCommand.java index bd89db954..17e8e1aeb 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsCommand.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaGetConnectionsCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x06; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x06; @Override public int[] serialize() { diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsResponse.java index 9d3b298a2..107d921f6 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetConnectionsResponse.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaGetConnectionsResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x06; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x06; /** * Max supported connections diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersCommand.java index 17155c026..e6376b91f 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersCommand.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaGetCountersCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x05; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x05; @Override public int[] serialize() { diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersResponse.java index ba65ba8b8..5dd1c812f 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetCountersResponse.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaGetCountersResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x05; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x05; /** * Number of transmitted packets diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoCommand.java index 6238c9d3d..ed808a18f 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoCommand.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaGetInfoCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x08; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x08; @Override public int[] serialize() { diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoResponse.java index 4a33fbbbb..8cc4b13a6 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaGetInfoResponse.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaGetInfoResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x08; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x08; /** * Major software version diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloCommand.java index 5a9a17b75..4be707003 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloCommand.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaHelloCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x01; @Override public int[] serialize() { diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloResponse.java index 5af6edcad..dd426d6aa 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaHelloResponse.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaHelloResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x01; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x01; /** * Response constructor diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaNoLicenseKeyEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaNoLicenseKeyEvent.java index f5fd23421..7929babec 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaNoLicenseKeyEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaNoLicenseKeyEvent.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaNoLicenseKeyEvent extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x05; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x05; /** * Event constructor diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaProtocolErrorEvent.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaProtocolErrorEvent.java index 5bd9bfc33..837612ced 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaProtocolErrorEvent.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaProtocolErrorEvent.java @@ -32,8 +32,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaProtocolErrorEvent extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x06; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x06; /** * Reason for failure diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetCommand.java index 0969e642a..086af2506 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetCommand.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaResetCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x00; /** * Selects the boot mode. 0 : boot to main program. 1 : boot to DFU diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetResponse.java index ba37d5b13..bacd1456f 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaResetResponse.java @@ -28,8 +28,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaResetResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x00; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x00; /** * Response constructor diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendCommand.java index b202da1e3..749fae29d 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendCommand.java @@ -32,8 +32,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaWhitelistAppendCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x0A; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x0A; /** * Bluetooth device address to add to the running white list. Maximum of 8 can be stored before diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendResponse.java index 39ffea698..6f3182142 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistAppendResponse.java @@ -33,8 +33,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaWhitelistAppendResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x0A; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x0A; /** * Command result diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearCommand.java index 412a0c959..684053619 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearCommand.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaWhitelistClearCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x0C; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x0C; @Override public int[] serialize() { diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearResponse.java index c0a042f26..2b742c03e 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistClearResponse.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaResponse; */ @NonNullByDefault public class BlueGigaWhitelistClearResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x0C; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x0C; /** * Response constructor diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveCommand.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveCommand.java index 9575db516..a518f949c 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveCommand.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveCommand.java @@ -29,8 +29,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.BlueGigaCommand; */ @NonNullByDefault public class BlueGigaWhitelistRemoveCommand extends BlueGigaCommand { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x0B; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x0B; /** * Bluetooth device address to remove from the running white list. diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveResponse.java index bc60d4b88..0f00011b4 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/command/system/BlueGigaWhitelistRemoveResponse.java @@ -30,8 +30,8 @@ import org.openhab.binding.bluetooth.bluegiga.internal.enumeration.BgApiResponse */ @NonNullByDefault public class BlueGigaWhitelistRemoveResponse extends BlueGigaResponse { - public static int COMMAND_CLASS = 0x00; - public static int COMMAND_METHOD = 0x0B; + public static final int COMMAND_CLASS = 0x00; + public static final int COMMAND_METHOD = 0x0B; /** * Command result diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirDataType.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirDataType.java index a1186c082..bd48eeb4a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirDataType.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirDataType.java @@ -16,6 +16,7 @@ import java.util.HashMap; import java.util.Map; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; /** * Assigned numbers are used in GAP for inquiry response, EIR data type values, manufacturer-specific data, advertising @@ -73,7 +74,7 @@ public enum EirDataType { * A mapping between the integer code and its corresponding type to * facilitate lookup by code. */ - private static Map codeMapping = new HashMap<>(); + private static @Nullable Map codeMapping; private int key; @@ -81,26 +82,24 @@ public enum EirDataType { this.key = key; } - private static void initMapping() { - for (EirDataType s : values()) { - codeMapping.put(s.key, s); - } - } - /** - * Lookup function based on the type code. Returns null if the code does not exist. + * Lookup function based on the type code. Returns {@link UNKNOWN} if the code does not exist. * * @param bluetoothAddressType * the code to lookup * @return enumeration value. */ - @SuppressWarnings({ "null", "unused" }) public static EirDataType getEirPacketType(int eirDataType) { - if (codeMapping.isEmpty()) { - initMapping(); + Map localCodeMapping = codeMapping; + if (localCodeMapping == null) { + localCodeMapping = new HashMap<>(); + for (EirDataType s : values()) { + localCodeMapping.put(s.key, s); + } + codeMapping = localCodeMapping; } - return codeMapping.getOrDefault(eirDataType, UNKNOWN); + return localCodeMapping.getOrDefault(eirDataType, UNKNOWN); } /** diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirFlags.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirFlags.java index 2041989e9..4a7f2ad8a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirFlags.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/eir/EirFlags.java @@ -16,6 +16,7 @@ import java.util.HashMap; import java.util.Map; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; /** * Definition of the EIR Flags field @@ -47,7 +48,7 @@ public enum EirFlags { * A mapping between the integer code and its corresponding type to * facilitate lookup by code. */ - private static Map codeMapping = new HashMap<>(); + private static @Nullable Map codeMapping; private int key; @@ -55,27 +56,24 @@ public enum EirFlags { this.key = key; } - private static void initMapping() { - codeMapping = new HashMap<>(); - for (EirFlags s : values()) { - codeMapping.put(s.key, s); - } - } - /** - * Lookup function based on the type code. Returns null if the code does not exist. + * Lookup function based on the type code. Returns {@link UNKNOWN} if the code does not exist. * * @param bluetoothAddressType * the code to lookup * @return enumeration value. */ - @SuppressWarnings({ "null", "unused" }) public static EirFlags getEirFlag(int eirFlag) { - if (codeMapping.isEmpty()) { - initMapping(); + Map localCodeMapping = codeMapping; + if (localCodeMapping == null) { + localCodeMapping = new HashMap<>(); + for (EirFlags s : values()) { + localCodeMapping.put(s.key, s); + } + codeMapping = localCodeMapping; } - return codeMapping.getOrDefault(eirFlag, UNKNOWN); + return localCodeMapping.getOrDefault(eirFlag, UNKNOWN); } /** diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeChangeReason.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeChangeReason.java index ca17d5c08..855af8d84 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeChangeReason.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeChangeReason.java @@ -15,6 +15,9 @@ package org.openhab.binding.bluetooth.bluegiga.internal.enumeration; import java.util.HashMap; import java.util.Map; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + /** * Class to implement the BlueGiga Enumeration AttributeChangeReason. *

@@ -24,6 +27,7 @@ import java.util.Map; * * @author Chris Jackson - Initial contribution of Java code generator */ +@NonNullByDefault public enum AttributeChangeReason { /** * Default unknown value @@ -53,7 +57,7 @@ public enum AttributeChangeReason { * A mapping between the integer code and its corresponding type to * facilitate lookup by code. */ - private static Map codeMapping; + private static @Nullable Map codeMapping; private int key; @@ -61,30 +65,24 @@ public enum AttributeChangeReason { this.key = key; } - private static void initMapping() { - codeMapping = new HashMap<>(); - for (AttributeChangeReason s : values()) { - codeMapping.put(s.key, s); - } - } - /** - * Lookup function based on the type code. Returns null if the code does not exist. + * Lookup function based on the type code. Returns {@link UNKNOWN} if the code does not exist. * * @param attributeChangeReason * the code to lookup * @return enumeration value. */ public static AttributeChangeReason getAttributeChangeReason(int attributeChangeReason) { - if (codeMapping == null) { - initMapping(); + Map localCodeMapping = codeMapping; + if (localCodeMapping == null) { + localCodeMapping = new HashMap<>(); + for (AttributeChangeReason s : values()) { + localCodeMapping.put(s.key, s); + } + codeMapping = localCodeMapping; } - if (codeMapping.get(attributeChangeReason) == null) { - return UNKNOWN; - } - - return codeMapping.get(attributeChangeReason); + return localCodeMapping.getOrDefault(attributeChangeReason, UNKNOWN); } /** diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeValueType.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeValueType.java index ff428865f..2bee872d6 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeValueType.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/AttributeValueType.java @@ -15,6 +15,9 @@ package org.openhab.binding.bluetooth.bluegiga.internal.enumeration; import java.util.HashMap; import java.util.Map; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + /** * Class to implement the BlueGiga Enumeration AttributeValueType. *

@@ -24,6 +27,7 @@ import java.util.Map; * * @author Chris Jackson - Initial contribution of Java code generator */ +@NonNullByDefault public enum AttributeValueType { /** * Default unknown value @@ -65,7 +69,7 @@ public enum AttributeValueType { * A mapping between the integer code and its corresponding type to * facilitate lookup by code. */ - private static Map codeMapping; + private static @Nullable Map codeMapping; private int key; @@ -73,30 +77,24 @@ public enum AttributeValueType { this.key = key; } - private static void initMapping() { - codeMapping = new HashMap<>(); - for (AttributeValueType s : values()) { - codeMapping.put(s.key, s); - } - } - /** - * Lookup function based on the type code. Returns null if the code does not exist. + * Lookup function based on the type code. Returns {@link UNKNOWN} if the code does not exist. * * @param attributeValueType * the code to lookup * @return enumeration value. */ public static AttributeValueType getAttributeValueType(int attributeValueType) { - if (codeMapping == null) { - initMapping(); + Map localCodeMapping = codeMapping; + if (localCodeMapping == null) { + localCodeMapping = new HashMap<>(); + for (AttributeValueType s : values()) { + localCodeMapping.put(s.key, s); + } + codeMapping = localCodeMapping; } - if (codeMapping.get(attributeValueType) == null) { - return UNKNOWN; - } - - return codeMapping.get(attributeValueType); + return localCodeMapping.getOrDefault(attributeValueType, UNKNOWN); } /** diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BgApiResponse.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BgApiResponse.java index b1dd4a762..e354a904d 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BgApiResponse.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BgApiResponse.java @@ -15,6 +15,9 @@ package org.openhab.binding.bluetooth.bluegiga.internal.enumeration; import java.util.HashMap; import java.util.Map; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + /** * Class to implement the BlueGiga Enumeration BgApiResponse. *

@@ -24,6 +27,7 @@ import java.util.Map; * * @author Chris Jackson - Initial contribution of Java code generator */ +@NonNullByDefault public enum BgApiResponse { /** * Default unknown value @@ -433,7 +437,7 @@ public enum BgApiResponse { * A mapping between the integer code and its corresponding type to * facilitate lookup by code. */ - private static Map codeMapping; + private static @Nullable Map codeMapping; private int key; @@ -441,30 +445,24 @@ public enum BgApiResponse { this.key = key; } - private static void initMapping() { - codeMapping = new HashMap<>(); - for (BgApiResponse s : values()) { - codeMapping.put(s.key, s); - } - } - /** - * Lookup function based on the type code. Returns null if the code does not exist. + * Lookup function based on the type code. Returns {@link UNKNOWN} if the code does not exist. * * @param bgApiResponse * the code to lookup * @return enumeration value. */ public static BgApiResponse getBgApiResponse(int bgApiResponse) { - if (codeMapping == null) { - initMapping(); + Map localCodeMapping = codeMapping; + if (localCodeMapping == null) { + localCodeMapping = new HashMap<>(); + for (BgApiResponse s : values()) { + localCodeMapping.put(s.key, s); + } + codeMapping = localCodeMapping; } - if (codeMapping.get(bgApiResponse) == null) { - return UNKNOWN; - } - - return codeMapping.get(bgApiResponse); + return localCodeMapping.getOrDefault(bgApiResponse, UNKNOWN); } /** diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BluetoothAddressType.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BluetoothAddressType.java index 2eb78e17d..8287fb8b7 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BluetoothAddressType.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/BluetoothAddressType.java @@ -15,6 +15,9 @@ package org.openhab.binding.bluetooth.bluegiga.internal.enumeration; import java.util.HashMap; import java.util.Map; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + /** * Class to implement the BlueGiga Enumeration BluetoothAddressType. *

@@ -24,6 +27,7 @@ import java.util.Map; * * @author Chris Jackson - Initial contribution of Java code generator */ +@NonNullByDefault public enum BluetoothAddressType { /** * Default unknown value @@ -44,7 +48,7 @@ public enum BluetoothAddressType { * A mapping between the integer code and its corresponding type to * facilitate lookup by code. */ - private static Map codeMapping; + private static @Nullable Map codeMapping; private int key; @@ -52,30 +56,24 @@ public enum BluetoothAddressType { this.key = key; } - private static void initMapping() { - codeMapping = new HashMap<>(); - for (BluetoothAddressType s : values()) { - codeMapping.put(s.key, s); - } - } - /** - * Lookup function based on the type code. Returns null if the code does not exist. + * Lookup function based on the type code. Returns {@link UNKNOWN} if the code does not exist. * * @param bluetoothAddressType * the code to lookup * @return enumeration value. */ public static BluetoothAddressType getBluetoothAddressType(int bluetoothAddressType) { - if (codeMapping == null) { - initMapping(); + Map localCodeMapping = codeMapping; + if (localCodeMapping == null) { + localCodeMapping = new HashMap<>(); + for (BluetoothAddressType s : values()) { + localCodeMapping.put(s.key, s); + } + codeMapping = localCodeMapping; } - if (codeMapping.get(bluetoothAddressType) == null) { - return UNKNOWN; - } - - return codeMapping.get(bluetoothAddressType); + return localCodeMapping.getOrDefault(bluetoothAddressType, UNKNOWN); } /** diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ConnectionStatusFlag.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ConnectionStatusFlag.java index 200ce93bd..c27308b89 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ConnectionStatusFlag.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ConnectionStatusFlag.java @@ -15,6 +15,9 @@ package org.openhab.binding.bluetooth.bluegiga.internal.enumeration; import java.util.HashMap; import java.util.Map; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + /** * Class to implement the BlueGiga Enumeration ConnectionStatusFlag. *

@@ -26,6 +29,7 @@ import java.util.Map; * * @author Chris Jackson - Initial contribution of Java code generator */ +@NonNullByDefault public enum ConnectionStatusFlag { /** * Default unknown value @@ -57,7 +61,7 @@ public enum ConnectionStatusFlag { * A mapping between the integer code and its corresponding type to * facilitate lookup by code. */ - private static Map codeMapping; + private static @Nullable Map codeMapping; private int key; @@ -65,30 +69,24 @@ public enum ConnectionStatusFlag { this.key = key; } - private static void initMapping() { - codeMapping = new HashMap<>(); - for (ConnectionStatusFlag s : values()) { - codeMapping.put(s.key, s); - } - } - /** - * Lookup function based on the type code. Returns null if the code does not exist. + * Lookup function based on the type code. Returns {@link UNKNOWN} if the code does not exist. * * @param connectionStatusFlag * the code to lookup * @return enumeration value. */ public static ConnectionStatusFlag getConnectionStatusFlag(int connectionStatusFlag) { - if (codeMapping == null) { - initMapping(); + Map localCodeMapping = codeMapping; + if (localCodeMapping == null) { + localCodeMapping = new HashMap<>(); + for (ConnectionStatusFlag s : values()) { + localCodeMapping.put(s.key, s); + } + codeMapping = localCodeMapping; } - if (codeMapping.get(connectionStatusFlag) == null) { - return UNKNOWN; - } - - return codeMapping.get(connectionStatusFlag); + return localCodeMapping.getOrDefault(connectionStatusFlag, UNKNOWN); } /** diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapConnectableMode.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapConnectableMode.java index 4f44b4ba6..689f9adcf 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapConnectableMode.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapConnectableMode.java @@ -15,6 +15,9 @@ package org.openhab.binding.bluetooth.bluegiga.internal.enumeration; import java.util.HashMap; import java.util.Map; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + /** * Class to implement the BlueGiga Enumeration GapConnectableMode. *

@@ -24,6 +27,7 @@ import java.util.Map; * * @author Chris Jackson - Initial contribution of Java code generator */ +@NonNullByDefault public enum GapConnectableMode { /** * Default unknown value @@ -55,7 +59,7 @@ public enum GapConnectableMode { * A mapping between the integer code and its corresponding type to * facilitate lookup by code. */ - private static Map codeMapping; + private static @Nullable Map codeMapping; private int key; @@ -63,30 +67,24 @@ public enum GapConnectableMode { this.key = key; } - private static void initMapping() { - codeMapping = new HashMap<>(); - for (GapConnectableMode s : values()) { - codeMapping.put(s.key, s); - } - } - /** - * Lookup function based on the type code. Returns null if the code does not exist. + * Lookup function based on the type code. Returns {@link UNKNOWN} if the code does not exist. * * @param gapConnectableMode * the code to lookup * @return enumeration value. */ public static GapConnectableMode getGapConnectableMode(int gapConnectableMode) { - if (codeMapping == null) { - initMapping(); + Map localCodeMapping = codeMapping; + if (localCodeMapping == null) { + localCodeMapping = new HashMap<>(); + for (GapConnectableMode s : values()) { + localCodeMapping.put(s.key, s); + } + codeMapping = localCodeMapping; } - if (codeMapping.get(gapConnectableMode) == null) { - return UNKNOWN; - } - - return codeMapping.get(gapConnectableMode); + return localCodeMapping.getOrDefault(gapConnectableMode, UNKNOWN); } /** diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverMode.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverMode.java index 116a1f6e5..7ed1444e2 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverMode.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverMode.java @@ -15,6 +15,9 @@ package org.openhab.binding.bluetooth.bluegiga.internal.enumeration; import java.util.HashMap; import java.util.Map; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + /** * Class to implement the BlueGiga Enumeration GapDiscoverMode. *

@@ -24,6 +27,7 @@ import java.util.Map; * * @author Chris Jackson - Initial contribution of Java code generator */ +@NonNullByDefault public enum GapDiscoverMode { /** * Default unknown value @@ -72,7 +76,7 @@ public enum GapDiscoverMode { * A mapping between the integer code and its corresponding type to * facilitate lookup by code. */ - private static Map codeMapping; + private static @Nullable Map codeMapping; private int key; @@ -80,30 +84,24 @@ public enum GapDiscoverMode { this.key = key; } - private static void initMapping() { - codeMapping = new HashMap<>(); - for (GapDiscoverMode s : values()) { - codeMapping.put(s.key, s); - } - } - /** - * Lookup function based on the type code. Returns null if the code does not exist. + * Lookup function based on the type code. Returns {@link UNKNOWN} if the code does not exist. * * @param gapDiscoverMode * the code to lookup * @return enumeration value. */ public static GapDiscoverMode getGapDiscoverMode(int gapDiscoverMode) { - if (codeMapping == null) { - initMapping(); + Map localCodeMapping = codeMapping; + if (localCodeMapping == null) { + localCodeMapping = new HashMap<>(); + for (GapDiscoverMode s : values()) { + localCodeMapping.put(s.key, s); + } + codeMapping = localCodeMapping; } - if (codeMapping.get(gapDiscoverMode) == null) { - return UNKNOWN; - } - - return codeMapping.get(gapDiscoverMode); + return localCodeMapping.getOrDefault(gapDiscoverMode, UNKNOWN); } /** diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverableMode.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverableMode.java index deab96b1c..14a157017 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverableMode.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/GapDiscoverableMode.java @@ -15,6 +15,9 @@ package org.openhab.binding.bluetooth.bluegiga.internal.enumeration; import java.util.HashMap; import java.util.Map; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + /** * Class to implement the BlueGiga Enumeration GapDiscoverableMode. *

@@ -24,6 +27,7 @@ import java.util.Map; * * @author Chris Jackson - Initial contribution of Java code generator */ +@NonNullByDefault public enum GapDiscoverableMode { /** * Default unknown value @@ -72,7 +76,7 @@ public enum GapDiscoverableMode { * A mapping between the integer code and its corresponding type to * facilitate lookup by code. */ - private static Map codeMapping; + private static @Nullable Map codeMapping; private int key; @@ -80,30 +84,24 @@ public enum GapDiscoverableMode { this.key = key; } - private static void initMapping() { - codeMapping = new HashMap<>(); - for (GapDiscoverableMode s : values()) { - codeMapping.put(s.key, s); - } - } - /** - * Lookup function based on the type code. Returns null if the code does not exist. + * Lookup function based on the type code. Returns {@link UNKNOWN} if the code does not exist. * * @param gapDiscoverableMode * the code to lookup * @return enumeration value. */ public static GapDiscoverableMode getGapDiscoverableMode(int gapDiscoverableMode) { - if (codeMapping == null) { - initMapping(); + Map localCodeMapping = codeMapping; + if (localCodeMapping == null) { + localCodeMapping = new HashMap<>(); + for (GapDiscoverableMode s : values()) { + localCodeMapping.put(s.key, s); + } + codeMapping = localCodeMapping; } - if (codeMapping.get(gapDiscoverableMode) == null) { - return UNKNOWN; - } - - return codeMapping.get(gapDiscoverableMode); + return localCodeMapping.getOrDefault(gapDiscoverableMode, UNKNOWN); } /** diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ScanResponseType.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ScanResponseType.java index 38895ec00..e385faa74 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ScanResponseType.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/ScanResponseType.java @@ -15,6 +15,9 @@ package org.openhab.binding.bluetooth.bluegiga.internal.enumeration; import java.util.HashMap; import java.util.Map; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + /** * Class to implement the BlueGiga Enumeration ScanResponseType. *

@@ -24,6 +27,7 @@ import java.util.Map; * * @author Chris Jackson - Initial contribution of Java code generator */ +@NonNullByDefault public enum ScanResponseType { /** * Default unknown value @@ -54,7 +58,7 @@ public enum ScanResponseType { * A mapping between the integer code and its corresponding type to * facilitate lookup by code. */ - private static Map codeMapping; + private static @Nullable Map codeMapping; private int key; @@ -62,30 +66,24 @@ public enum ScanResponseType { this.key = key; } - private static void initMapping() { - codeMapping = new HashMap<>(); - for (ScanResponseType s : values()) { - codeMapping.put(s.key, s); - } - } - /** - * Lookup function based on the type code. Returns null if the code does not exist. + * Lookup function based on the type code. Returns {@link UNKNOWN} if the code does not exist. * * @param scanResponseType * the code to lookup * @return enumeration value. */ public static ScanResponseType getScanResponseType(int scanResponseType) { - if (codeMapping == null) { - initMapping(); + Map localCodeMapping = codeMapping; + if (localCodeMapping == null) { + localCodeMapping = new HashMap<>(); + for (ScanResponseType s : values()) { + localCodeMapping.put(s.key, s); + } + codeMapping = localCodeMapping; } - if (codeMapping.get(scanResponseType) == null) { - return UNKNOWN; - } - - return codeMapping.get(scanResponseType); + return localCodeMapping.getOrDefault(scanResponseType, UNKNOWN); } /** diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/SmpIoCapabilities.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/SmpIoCapabilities.java index 053cd3a18..0a7c9cda1 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/SmpIoCapabilities.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/enumeration/SmpIoCapabilities.java @@ -15,6 +15,9 @@ package org.openhab.binding.bluetooth.bluegiga.internal.enumeration; import java.util.HashMap; import java.util.Map; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; + /** * Class to implement the BlueGiga Enumeration SmpIoCapabilities. *

@@ -24,6 +27,7 @@ import java.util.Map; * * @author Chris Jackson - Initial contribution of Java code generator */ +@NonNullByDefault public enum SmpIoCapabilities { /** * Default unknown value @@ -59,7 +63,7 @@ public enum SmpIoCapabilities { * A mapping between the integer code and its corresponding type to * facilitate lookup by code. */ - private static Map codeMapping; + private static @Nullable Map codeMapping; private int key; @@ -67,30 +71,24 @@ public enum SmpIoCapabilities { this.key = key; } - private static void initMapping() { - codeMapping = new HashMap<>(); - for (SmpIoCapabilities s : values()) { - codeMapping.put(s.key, s); - } - } - /** - * Lookup function based on the type code. Returns null if the code does not exist. + * Lookup function based on the type code. Returns {@link UNKNOWN} if the code does not exist. * * @param smpIoCapabilities * the code to lookup * @return enumeration value. */ public static SmpIoCapabilities getSmpIoCapabilities(int smpIoCapabilities) { - if (codeMapping == null) { - initMapping(); + Map localCodeMapping = codeMapping; + if (localCodeMapping == null) { + localCodeMapping = new HashMap<>(); + for (SmpIoCapabilities s : values()) { + localCodeMapping.put(s.key, s); + } + codeMapping = localCodeMapping; } - if (codeMapping.get(smpIoCapabilities) == null) { - return UNKNOWN; - } - - return codeMapping.get(smpIoCapabilities); + return localCodeMapping.getOrDefault(smpIoCapabilities, UNKNOWN); } /** diff --git a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/factory/BlueGigaHandlerFactory.java b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/factory/BlueGigaHandlerFactory.java index 935e202f1..256982b6a 100644 --- a/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/factory/BlueGigaHandlerFactory.java +++ b/bundles/org.openhab.binding.bluetooth.bluegiga/src/main/java/org/openhab/binding/bluetooth/bluegiga/internal/factory/BlueGigaHandlerFactory.java @@ -88,7 +88,6 @@ public class BlueGigaHandlerFactory extends BaseThingHandlerFactory { bundleContext.registerService(BluetoothAdapter.class.getName(), adapter, new Hashtable<>())); } - @SuppressWarnings("null") @Override protected synchronized void removeHandler(ThingHandler thingHandler) { if (thingHandler instanceof BluetoothAdapter) {