diff --git a/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/filter/PersistenceEqualsFilter.java b/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/filter/PersistenceEqualsFilter.java index fdceb2863a8..45ccbc69c2b 100644 --- a/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/filter/PersistenceEqualsFilter.java +++ b/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/filter/PersistenceEqualsFilter.java @@ -15,6 +15,7 @@ import java.util.Collection; import org.eclipse.jdt.annotation.NonNullByDefault; +import org.eclipse.jdt.annotation.Nullable; import org.openhab.core.items.Item; /** @@ -29,10 +30,10 @@ public class PersistenceEqualsFilter extends PersistenceFilter { private final Collection values; private final boolean inverted; - public PersistenceEqualsFilter(String name, Collection values, boolean inverted) { + public PersistenceEqualsFilter(String name, Collection values, @Nullable Boolean inverted) { super(name); this.values = values; - this.inverted = inverted; + this.inverted = (inverted == null) ? false : inverted; } public Collection getValues() { diff --git a/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/filter/PersistenceIncludeFilter.java b/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/filter/PersistenceIncludeFilter.java index 8b3181a38a7..2ca7fc36470 100644 --- a/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/filter/PersistenceIncludeFilter.java +++ b/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/filter/PersistenceIncludeFilter.java @@ -40,12 +40,12 @@ public class PersistenceIncludeFilter extends PersistenceFilter { private final boolean inverted; public PersistenceIncludeFilter(String name, BigDecimal lower, BigDecimal upper, @Nullable String unit, - boolean inverted) { + @Nullable Boolean inverted) { super(name); this.lower = lower; this.upper = upper; this.unit = (unit == null) ? "" : unit; - this.inverted = inverted; + this.inverted = (inverted == null) ? false : inverted; } public BigDecimal getLower() { diff --git a/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/filter/PersistenceThresholdFilter.java b/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/filter/PersistenceThresholdFilter.java index 1a15070e939..b841c0548bb 100644 --- a/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/filter/PersistenceThresholdFilter.java +++ b/bundles/org.openhab.core.persistence/src/main/java/org/openhab/core/persistence/filter/PersistenceThresholdFilter.java @@ -48,11 +48,12 @@ public class PersistenceThresholdFilter extends PersistenceFilter { private final transient Map valueCache = new HashMap<>(); - public PersistenceThresholdFilter(String name, BigDecimal value, @Nullable String unit, boolean relative) { + public PersistenceThresholdFilter(String name, BigDecimal value, @Nullable String unit, + @Nullable Boolean relative) { super(name); this.value = value; this.unit = (unit == null) ? "" : unit; - this.relative = relative; + this.relative = (relative == null) ? false : relative; } public BigDecimal getValue() {