From 8401cb3ca547329d35c215d4dea3b026378f8b90 Mon Sep 17 00:00:00 2001 From: yannick Date: Wed, 31 Jul 2024 11:27:32 +0200 Subject: [PATCH] fix annotation attributes --- .../edge/adapters/modbus/config/AddressRange.java | 6 ++++-- .../adapters/modbus/config/ModbusAdapterConfig.java | 3 +-- .../adapters/modbus/config/PollingContextImpl.java | 10 +++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/modules/hivemq-edge-module-modbus/src/main/java/com/hivemq/edge/adapters/modbus/config/AddressRange.java b/modules/hivemq-edge-module-modbus/src/main/java/com/hivemq/edge/adapters/modbus/config/AddressRange.java index b82f33e037..9a816a895a 100644 --- a/modules/hivemq-edge-module-modbus/src/main/java/com/hivemq/edge/adapters/modbus/config/AddressRange.java +++ b/modules/hivemq-edge-module-modbus/src/main/java/com/hivemq/edge/adapters/modbus/config/AddressRange.java @@ -11,14 +11,16 @@ public class AddressRange { @ModuleConfigField(title = "Start Index", description = "The Starting Index (Incl.) of the Address Range", numberMin = 0, - numberMax = ModbusAdapterConfig.PORT_MAX) + numberMax = ModbusAdapterConfig.PORT_MAX, + required = true) public final int startIdx; @JsonProperty("endIdx") @ModuleConfigField(title = "End Index", description = "The Finishing Index (Excl.) of the Address Range", numberMin = 1, - numberMax = ModbusAdapterConfig.PORT_MAX) + numberMax = ModbusAdapterConfig.PORT_MAX, + required = true) public final int endIdx; public AddressRange( diff --git a/modules/hivemq-edge-module-modbus/src/main/java/com/hivemq/edge/adapters/modbus/config/ModbusAdapterConfig.java b/modules/hivemq-edge-module-modbus/src/main/java/com/hivemq/edge/adapters/modbus/config/ModbusAdapterConfig.java index f6b36fd538..c7ec6dbae2 100644 --- a/modules/hivemq-edge-module-modbus/src/main/java/com/hivemq/edge/adapters/modbus/config/ModbusAdapterConfig.java +++ b/modules/hivemq-edge-module-modbus/src/main/java/com/hivemq/edge/adapters/modbus/config/ModbusAdapterConfig.java @@ -79,8 +79,7 @@ public class ModbusAdapterConfig implements ProtocolAdapterConfig { description = "Time (in milliseconds) to await a connection before the client gives up", numberMin = 1000, numberMax = 15000, - defaultValue = "5000", - required = true) + defaultValue = "5000") private final int timeout; @JsonProperty("publishChangedDataOnly") diff --git a/modules/hivemq-edge-module-modbus/src/main/java/com/hivemq/edge/adapters/modbus/config/PollingContextImpl.java b/modules/hivemq-edge-module-modbus/src/main/java/com/hivemq/edge/adapters/modbus/config/PollingContextImpl.java index 928141af66..01c4c71390 100644 --- a/modules/hivemq-edge-module-modbus/src/main/java/com/hivemq/edge/adapters/modbus/config/PollingContextImpl.java +++ b/modules/hivemq-edge-module-modbus/src/main/java/com/hivemq/edge/adapters/modbus/config/PollingContextImpl.java @@ -69,12 +69,12 @@ public class PollingContextImpl implements PollingContext { @JsonCreator public PollingContextImpl( @JsonProperty(value = "destination", required = true) final @NotNull String destination, - @JsonProperty(value = "qos") final @Nullable Integer qos, - @JsonProperty(value = "messageHandlingOptions") final @Nullable MessageHandlingOptions messageHandlingOptions, - @JsonProperty(value = "includeTimestamp") final @Nullable Boolean includeTimestamp, - @JsonProperty(value = "includeTagNames") final @Nullable Boolean includeTagNames, + @JsonProperty("qos") final @Nullable Integer qos, + @JsonProperty("messageHandlingOptions") final @Nullable MessageHandlingOptions messageHandlingOptions, + @JsonProperty("includeTimestamp") final @Nullable Boolean includeTimestamp, + @JsonProperty("includeTagNames") final @Nullable Boolean includeTagNames, @JsonProperty("userProperties") final @Nullable List userProperties, - @JsonProperty("addressRange") final @NotNull AddressRange addressRange) { + @JsonProperty(value = "addressRange", required = true) final @NotNull AddressRange addressRange) { this.destination = destination; this.qos = requireNonNullElse(qos, 0); this.messageHandlingOptions = requireNonNullElse(messageHandlingOptions, MQTTMessagePerSubscription);