mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-25 19:55:48 +01:00
Added missing nullness annotations to discovery events (#1621)
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
This commit is contained in:
parent
72a5afadce
commit
f7c8505d7a
@ -14,6 +14,7 @@ package org.openhab.core.config.discovery.inbox;
|
|||||||
|
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
|
|
||||||
|
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||||
import org.openhab.core.config.discovery.DiscoveryResult;
|
import org.openhab.core.config.discovery.DiscoveryResult;
|
||||||
import org.openhab.core.config.discovery.internal.AutomaticInboxProcessor;
|
import org.openhab.core.config.discovery.internal.AutomaticInboxProcessor;
|
||||||
import org.osgi.service.component.annotations.Component;
|
import org.osgi.service.component.annotations.Component;
|
||||||
@ -34,6 +35,7 @@ import org.osgi.service.component.annotations.Component;
|
|||||||
*
|
*
|
||||||
* @author Henning Sudbrock - Initial contribution
|
* @author Henning Sudbrock - Initial contribution
|
||||||
*/
|
*/
|
||||||
|
@NonNullByDefault
|
||||||
public interface InboxAutoApprovePredicate extends Predicate<DiscoveryResult> {
|
public interface InboxAutoApprovePredicate extends Predicate<DiscoveryResult> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.openhab.core.config.discovery.inbox.events;
|
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.dto.DiscoveryResultDTO;
|
||||||
import org.openhab.core.config.discovery.inbox.Inbox;
|
import org.openhab.core.config.discovery.inbox.Inbox;
|
||||||
import org.openhab.core.events.AbstractEvent;
|
import org.openhab.core.events.AbstractEvent;
|
||||||
@ -22,6 +23,7 @@ import org.openhab.core.events.AbstractEvent;
|
|||||||
*
|
*
|
||||||
* @author Stefan Bußweiler - Initial contribution
|
* @author Stefan Bußweiler - Initial contribution
|
||||||
*/
|
*/
|
||||||
|
@NonNullByDefault
|
||||||
public abstract class AbstractInboxEvent extends AbstractEvent {
|
public abstract class AbstractInboxEvent extends AbstractEvent {
|
||||||
|
|
||||||
private final DiscoveryResultDTO discoveryResult;
|
private final DiscoveryResultDTO discoveryResult;
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.openhab.core.config.discovery.inbox.events;
|
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.dto.DiscoveryResultDTO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -20,6 +21,7 @@ import org.openhab.core.config.discovery.dto.DiscoveryResultDTO;
|
|||||||
*
|
*
|
||||||
* @author Stefan Bußweiler - Initial contribution
|
* @author Stefan Bußweiler - Initial contribution
|
||||||
*/
|
*/
|
||||||
|
@NonNullByDefault
|
||||||
public class InboxAddedEvent extends AbstractInboxEvent {
|
public class InboxAddedEvent extends AbstractInboxEvent {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,9 +12,10 @@
|
|||||||
*/
|
*/
|
||||||
package org.openhab.core.config.discovery.inbox.events;
|
package org.openhab.core.config.discovery.inbox.events;
|
||||||
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.Set;
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
|
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.DiscoveryResult;
|
||||||
import org.openhab.core.config.discovery.dto.DiscoveryResultDTO;
|
import org.openhab.core.config.discovery.dto.DiscoveryResultDTO;
|
||||||
import org.openhab.core.config.discovery.dto.DiscoveryResultDTOMapper;
|
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
|
* @author Stefan Bußweiler - Initial contribution
|
||||||
*/
|
*/
|
||||||
|
@NonNullByDefault
|
||||||
@Component(immediate = true, service = EventFactory.class)
|
@Component(immediate = true, service = EventFactory.class)
|
||||||
public class InboxEventFactory extends AbstractEventFactory {
|
public class InboxEventFactory extends AbstractEventFactory {
|
||||||
|
|
||||||
@ -41,12 +43,12 @@ public class InboxEventFactory extends AbstractEventFactory {
|
|||||||
* Constructs a new InboxEventFactory.
|
* Constructs a new InboxEventFactory.
|
||||||
*/
|
*/
|
||||||
public InboxEventFactory() {
|
public InboxEventFactory() {
|
||||||
super(Stream.of(InboxAddedEvent.TYPE, InboxUpdatedEvent.TYPE, InboxRemovedEvent.TYPE)
|
super(Set.of(InboxAddedEvent.TYPE, InboxUpdatedEvent.TYPE, InboxRemovedEvent.TYPE));
|
||||||
.collect(Collectors.toSet()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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)) {
|
if (InboxAddedEvent.TYPE.equals(eventType)) {
|
||||||
return createAddedEvent(topic, payload);
|
return createAddedEvent(topic, payload);
|
||||||
} else if (InboxRemovedEvent.TYPE.equals(eventType)) {
|
} else if (InboxRemovedEvent.TYPE.equals(eventType)) {
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.openhab.core.config.discovery.inbox.events;
|
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.dto.DiscoveryResultDTO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -20,6 +21,7 @@ import org.openhab.core.config.discovery.dto.DiscoveryResultDTO;
|
|||||||
*
|
*
|
||||||
* @author Stefan Bußweiler - Initial contribution
|
* @author Stefan Bußweiler - Initial contribution
|
||||||
*/
|
*/
|
||||||
|
@NonNullByDefault
|
||||||
public class InboxRemovedEvent extends AbstractInboxEvent {
|
public class InboxRemovedEvent extends AbstractInboxEvent {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
package org.openhab.core.config.discovery.inbox.events;
|
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.dto.DiscoveryResultDTO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -20,6 +21,7 @@ import org.openhab.core.config.discovery.dto.DiscoveryResultDTO;
|
|||||||
*
|
*
|
||||||
* @author Stefan Bußweiler - Initial contribution
|
* @author Stefan Bußweiler - Initial contribution
|
||||||
*/
|
*/
|
||||||
|
@NonNullByDefault
|
||||||
public class InboxUpdatedEvent extends AbstractInboxEvent {
|
public class InboxUpdatedEvent extends AbstractInboxEvent {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user