Java 17 features (N-S) (#15565)
- 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:
@@ -56,10 +56,10 @@ public class UpdateSetting extends AbstractUplinkCommandCallback implements Nibe
|
||||
|
||||
private String extractValue(Command command) {
|
||||
// this is necessary because we must not send the unit to the nibe backend
|
||||
if (command instanceof QuantityType<?>) {
|
||||
return String.valueOf(((QuantityType<?>) command).doubleValue());
|
||||
} else if (command instanceof OnOffType) {
|
||||
return ChannelUtil.mapValue(channel, (OnOffType) command);
|
||||
if (command instanceof QuantityType<?> quantityCommand) {
|
||||
return String.valueOf(quantityCommand.doubleValue());
|
||||
} else if (command instanceof OnOffType onOffCommand) {
|
||||
return ChannelUtil.mapValue(channel, onOffCommand);
|
||||
} else {
|
||||
return command.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user