mirror of
https://github.com/aljazceru/signal-cli.git
synced 2025-12-25 10:04:23 +01:00
Fix dbus properties GetAll method for variants
This commit is contained in:
@@ -51,6 +51,7 @@ 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()) {
|
||||
@@ -61,6 +62,9 @@ public abstract class DbusProperties implements Properties {
|
||||
.getProperties()
|
||||
.stream()
|
||||
.filter(p -> p.getGetter() != null)
|
||||
.collect(Collectors.toMap(DbusProperty::getName, p -> new Variant<>(p.getGetter().get())));
|
||||
.collect(Collectors.toMap(DbusProperty::getName, p -> {
|
||||
final Object o = p.getGetter().get();
|
||||
return o instanceof Variant ? (Variant<Object>) o : new Variant<>(o);
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user