mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Fix dbus properties GetAll method for variants
This commit is contained in:
parent
c56a8df9b2
commit
179855272a
1 changed files with 5 additions and 1 deletions
|
@ -51,6 +51,7 @@ public abstract class DbusProperties implements Properties {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public Map<String, Variant<?>> GetAll(final String interface_name) {
|
public Map<String, Variant<?>> GetAll(final String interface_name) {
|
||||||
final var handler = getHandlerOptional(interface_name);
|
final var handler = getHandlerOptional(interface_name);
|
||||||
if (handler.isEmpty()) {
|
if (handler.isEmpty()) {
|
||||||
|
@ -61,6 +62,9 @@ public abstract class DbusProperties implements Properties {
|
||||||
.getProperties()
|
.getProperties()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(p -> p.getGetter() != null)
|
.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);
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue