Java 17 features (T-Z) (#15576)
- add missing @override - Java style array syntax - remove redundant modifiers - always move String constants to left side in comparisons - simplify lambda expressions and return statements - use replace instead of replaceAll w/o regex - instanceof matching and multiline strings - remove null check before instanceof Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
@@ -14,7 +14,6 @@ package org.openhab.binding.vektiva.internal;
|
||||
|
||||
import static org.openhab.binding.vektiva.internal.VektivaBindingConstants.THING_TYPE_SMARWI;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
@@ -43,7 +42,7 @@ import org.osgi.service.component.annotations.Reference;
|
||||
@Component(configurationPid = "binding.vektiva", service = ThingHandlerFactory.class)
|
||||
public class VektivaHandlerFactory extends BaseThingHandlerFactory {
|
||||
|
||||
private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Collections.singleton(THING_TYPE_SMARWI);
|
||||
private static final Set<ThingTypeUID> SUPPORTED_THING_TYPES_UIDS = Set.of(THING_TYPE_SMARWI);
|
||||
|
||||
/**
|
||||
* the shared http client
|
||||
|
||||
@@ -241,7 +241,7 @@ public class VektivaSmarwiHandler extends BaseThingHandler {
|
||||
statusMessage = "Blocked";
|
||||
}
|
||||
|
||||
int position = values.getOrDefault("pos", NA).equals("o") ? 0 : 100;
|
||||
int position = "o".equals(values.getOrDefault("pos", NA)) ? 0 : 100;
|
||||
if (position == 0 && lastPosition != -1) {
|
||||
position = lastPosition;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user