Use pattern matching switch cases

This commit is contained in:
AsamK 2023-10-17 19:52:35 +02:00
parent 80c1a6d2af
commit 8d55dfb66b
27 changed files with 395 additions and 380 deletions

View file

@ -65,7 +65,7 @@ public abstract class DbusProperties implements Properties {
.filter(p -> p.getGetter() != null)
.collect(Collectors.toMap(DbusProperty::getName, p -> {
final Object o = p.getGetter().get();
return o instanceof Variant ? (Variant<Object>) o : new Variant<>(o);
return o instanceof Variant<?> variant ? variant : new Variant<>(o);
}));
}
}