Java 17 features (A-G) (#15516)
- 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 Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
@@ -45,8 +45,8 @@ public class ElectroluxAirDiscoveryService extends AbstractDiscoveryService
|
||||
|
||||
@Override
|
||||
public void setThingHandler(@Nullable ThingHandler handler) {
|
||||
if (handler instanceof ElectroluxAirBridgeHandler) {
|
||||
this.handler = (ElectroluxAirBridgeHandler) handler;
|
||||
if (handler instanceof ElectroluxAirBridgeHandler bridgeHandler) {
|
||||
this.handler = bridgeHandler;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@ package org.openhab.binding.electroluxair.internal.handler;
|
||||
import static org.openhab.binding.electroluxair.internal.ElectroluxAirBindingConstants.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
@@ -50,7 +49,7 @@ import com.google.gson.Gson;
|
||||
@NonNullByDefault
|
||||
public class ElectroluxAirBridgeHandler extends BaseBridgeHandler {
|
||||
|
||||
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Collections.singleton(THING_TYPE_BRIDGE);
|
||||
public static final Set<ThingTypeUID> SUPPORTED_THING_TYPES = Set.of(THING_TYPE_BRIDGE);
|
||||
|
||||
private int refreshTimeInSeconds = 300;
|
||||
|
||||
@@ -100,7 +99,7 @@ public class ElectroluxAirBridgeHandler extends BaseBridgeHandler {
|
||||
|
||||
@Override
|
||||
public Collection<Class<? extends ThingHandlerService>> getServices() {
|
||||
return Collections.singleton(ElectroluxAirDiscoveryService.class);
|
||||
return Set.of(ElectroluxAirDiscoveryService.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user