]> nmode's Git Repositories - signal-cli/blobdiff - src/main/java/org/asamk/signal/dbus/DbusProperties.java
Extend getUserStatus command for usernames
[signal-cli] / src / main / java / org / asamk / signal / dbus / DbusProperties.java
index 256b858d080b4f5679dadb525e7b666ed8b8e0ac..419a034b2280b338e45d9a075b584b75872151cd 100644 (file)
@@ -52,7 +52,6 @@ public abstract class DbusProperties implements Properties {
     }
 
     @Override
-    @SuppressWarnings("unchecked")
     public Map<String, Variant<?>> GetAll(final String interface_name) {
         final var handler = getHandlerOptional(interface_name);
         if (handler.isEmpty()) {
@@ -65,7 +64,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);
                 }));
     }
 }