diff --git a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/InboxAutoApprovePredicate.java b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/InboxAutoApprovePredicate.java index 7c16770ca..a4b59a0e4 100644 --- a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/InboxAutoApprovePredicate.java +++ b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/InboxAutoApprovePredicate.java @@ -14,6 +14,7 @@ package org.openhab.core.config.discovery.inbox; import java.util.function.Predicate; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.core.config.discovery.DiscoveryResult; import org.openhab.core.config.discovery.internal.AutomaticInboxProcessor; import org.osgi.service.component.annotations.Component; @@ -34,6 +35,7 @@ import org.osgi.service.component.annotations.Component; * * @author Henning Sudbrock - Initial contribution */ +@NonNullByDefault public interface InboxAutoApprovePredicate extends Predicate { } diff --git a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/AbstractInboxEvent.java b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/AbstractInboxEvent.java index c68f5ec0f..369df5b28 100644 --- a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/AbstractInboxEvent.java +++ b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/AbstractInboxEvent.java @@ -12,6 +12,7 @@ */ package org.openhab.core.config.discovery.inbox.events; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.core.config.discovery.dto.DiscoveryResultDTO; import org.openhab.core.config.discovery.inbox.Inbox; import org.openhab.core.events.AbstractEvent; @@ -22,6 +23,7 @@ import org.openhab.core.events.AbstractEvent; * * @author Stefan Bußweiler - Initial contribution */ +@NonNullByDefault public abstract class AbstractInboxEvent extends AbstractEvent { private final DiscoveryResultDTO discoveryResult; @@ -40,7 +42,7 @@ public abstract class AbstractInboxEvent extends AbstractEvent { /** * Gets the discovery result as data transfer object. - * + * * @return the discoveryResult */ public DiscoveryResultDTO getDiscoveryResult() { diff --git a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxAddedEvent.java b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxAddedEvent.java index 0207b5b2d..0b5e8b580 100644 --- a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxAddedEvent.java +++ b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxAddedEvent.java @@ -12,6 +12,7 @@ */ package org.openhab.core.config.discovery.inbox.events; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.core.config.discovery.dto.DiscoveryResultDTO; /** @@ -20,6 +21,7 @@ import org.openhab.core.config.discovery.dto.DiscoveryResultDTO; * * @author Stefan Bußweiler - Initial contribution */ +@NonNullByDefault public class InboxAddedEvent extends AbstractInboxEvent { /** diff --git a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxEventFactory.java b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxEventFactory.java index a03b15558..5094272a9 100644 --- a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxEventFactory.java +++ b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxEventFactory.java @@ -12,9 +12,10 @@ */ package org.openhab.core.config.discovery.inbox.events; -import java.util.stream.Collectors; -import java.util.stream.Stream; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.openhab.core.config.discovery.DiscoveryResult; import org.openhab.core.config.discovery.dto.DiscoveryResultDTO; import org.openhab.core.config.discovery.dto.DiscoveryResultDTOMapper; @@ -28,6 +29,7 @@ import org.osgi.service.component.annotations.Component; * * @author Stefan Bußweiler - Initial contribution */ +@NonNullByDefault @Component(immediate = true, service = EventFactory.class) public class InboxEventFactory extends AbstractEventFactory { @@ -41,12 +43,12 @@ public class InboxEventFactory extends AbstractEventFactory { * Constructs a new InboxEventFactory. */ public InboxEventFactory() { - super(Stream.of(InboxAddedEvent.TYPE, InboxUpdatedEvent.TYPE, InboxRemovedEvent.TYPE) - .collect(Collectors.toSet())); + super(Set.of(InboxAddedEvent.TYPE, InboxUpdatedEvent.TYPE, InboxRemovedEvent.TYPE)); } @Override - protected Event createEventByType(String eventType, String topic, String payload, String source) throws Exception { + protected Event createEventByType(String eventType, String topic, String payload, @Nullable String source) + throws Exception { if (InboxAddedEvent.TYPE.equals(eventType)) { return createAddedEvent(topic, payload); } else if (InboxRemovedEvent.TYPE.equals(eventType)) { diff --git a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxRemovedEvent.java b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxRemovedEvent.java index 5fbd84eea..2d5d57a4d 100644 --- a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxRemovedEvent.java +++ b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxRemovedEvent.java @@ -12,6 +12,7 @@ */ package org.openhab.core.config.discovery.inbox.events; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.core.config.discovery.dto.DiscoveryResultDTO; /** @@ -20,6 +21,7 @@ import org.openhab.core.config.discovery.dto.DiscoveryResultDTO; * * @author Stefan Bußweiler - Initial contribution */ +@NonNullByDefault public class InboxRemovedEvent extends AbstractInboxEvent { /** diff --git a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxUpdatedEvent.java b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxUpdatedEvent.java index beafc75d8..2253b0a41 100644 --- a/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxUpdatedEvent.java +++ b/bundles/org.openhab.core.config.discovery/src/main/java/org/openhab/core/config/discovery/inbox/events/InboxUpdatedEvent.java @@ -12,6 +12,7 @@ */ package org.openhab.core.config.discovery.inbox.events; +import org.eclipse.jdt.annotation.NonNullByDefault; import org.openhab.core.config.discovery.dto.DiscoveryResultDTO; /** @@ -20,6 +21,7 @@ import org.openhab.core.config.discovery.dto.DiscoveryResultDTO; * * @author Stefan Bußweiler - Initial contribution */ +@NonNullByDefault public class InboxUpdatedEvent extends AbstractInboxEvent { /**