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:
@@ -77,7 +77,7 @@ public class ActionConditions {
|
||||
* @return RGB value + brightness as first byte
|
||||
*/
|
||||
private static @Nullable JsonElement hsvToBRGB(@Nullable Command command, @Nullable JsonElement value) {
|
||||
if (command != null && command instanceof HSBType) {
|
||||
if (command instanceof HSBType) {
|
||||
HSBType hsb = (HSBType) command;
|
||||
Color color = Color.getHSBColor(hsb.getHue().floatValue() / 360, hsb.getSaturation().floatValue() / 100,
|
||||
hsb.getBrightness().floatValue() / 100);
|
||||
@@ -119,7 +119,7 @@ public class ActionConditions {
|
||||
* @return
|
||||
*/
|
||||
private static @Nullable JsonElement hsbOnly(@Nullable Command command, @Nullable JsonElement value) {
|
||||
if (command != null && command instanceof HSBType) {
|
||||
if (command instanceof HSBType) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user