Java 17 features (H-M) (#15520)

- 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:
Holger Friedrich
2023-09-08 14:36:59 +02:00
committed by GitHub
parent 3751fd0646
commit edaf17b345
519 changed files with 2703 additions and 2660 deletions

View File

@@ -299,8 +299,11 @@ public class P1Payload {
@Override
public String toString() {
return String.format("P1 [version: %d model: %s ssid: %s signal: %d"
+ " imp1: %f imp2: %f exp1: %f exp2: %f active: %f active1: %f active2: %f active3: %f gas: %f timestamp: %.0f]",
return String.format(
"""
P1 [version: %d model: %s ssid: %s signal: %d\
imp1: %f imp2: %f exp1: %f exp2: %f active: %f active1: %f active2: %f active3: %f gas: %f timestamp: %.0f]\
""",
smrVersion, meterModel, wifiSsid, wifiStrength, totalEnergyImportT1Kwh, totalEnergyImportT2Kwh,
totalEnergyExportT1Kwh, totalEnergyExportT2Kwh, activePowerW, activePowerL1W, activePowerL2W,
activePowerL3W, totalGasM3, gasTimestamp);