mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Fix inspection issues
This commit is contained in:
parent
fc6a4b78eb
commit
caa4fa0180
12 changed files with 12 additions and 15 deletions
|
@ -94,7 +94,7 @@ public class DbusCommandHandler {
|
|||
"Multiple users found, you need to specify an account (phone number) with -a");
|
||||
}
|
||||
|
||||
return accounts.get(0).getPath();
|
||||
return accounts.getFirst().getPath();
|
||||
} catch (UnknownMethod e) {
|
||||
// dbus daemon not running in multi-account mode
|
||||
return null;
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -668,7 +668,7 @@ public class DbusSignalImpl implements Signal, AutoCloseable {
|
|||
@Override
|
||||
public boolean isRegistered(String number) {
|
||||
var result = isRegistered(List.of(number));
|
||||
return result.get(0);
|
||||
return result.getFirst();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,8 +2,6 @@ package org.asamk.signal.jsonrpc;
|
|||
|
||||
/**
|
||||
* Represents a JSON-RPC (batch) request or (batch) response.
|
||||
* https://www.jsonrpc.org/specification
|
||||
* <a href="https://www.jsonrpc.org/specification">https://www.jsonrpc.org/specification</a>
|
||||
*/
|
||||
public sealed abstract class JsonRpcMessage permits JsonRpcBatchMessage, JsonRpcRequest, JsonRpcResponse {
|
||||
|
||||
}
|
||||
public sealed abstract class JsonRpcMessage permits JsonRpcBatchMessage, JsonRpcRequest, JsonRpcResponse {}
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.fasterxml.jackson.databind.node.ValueNode;
|
|||
|
||||
/**
|
||||
* Represents a JSON-RPC request.
|
||||
* https://www.jsonrpc.org/specification#request_object
|
||||
* <a href="https://www.jsonrpc.org/specification#request_object">https://www.jsonrpc.org/specification#request_object</a>
|
||||
*/
|
||||
public final class JsonRpcRequest extends JsonRpcMessage {
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import com.fasterxml.jackson.databind.node.ValueNode;
|
|||
|
||||
/**
|
||||
* Represents a JSON-RPC response.
|
||||
* https://www.jsonrpc.org/specification#response_object
|
||||
* <a href="https://www.jsonrpc.org/specification#response_object">https://www.jsonrpc.org/specification#response_object</a>
|
||||
*/
|
||||
public final class JsonRpcResponse extends JsonRpcMessage {
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ public class SignalJsonRpcCommandHandler {
|
|||
if (manager == null) {
|
||||
final var managers = c.getManagers();
|
||||
if (managers.size() == 1) {
|
||||
manager = managers.get(0);
|
||||
manager = managers.getFirst();
|
||||
}
|
||||
}
|
||||
if (manager != null) {
|
||||
|
|
|
@ -126,7 +126,7 @@ public class SignalJsonRpcDispatcherHandler {
|
|||
private void unsubscribeReceive(final Manager m) {
|
||||
final var subscriptionId = receiveHandlers.entrySet()
|
||||
.stream()
|
||||
.filter(e -> e.getValue().size() == 1 && e.getValue().get(0).first().equals(m))
|
||||
.filter(e -> e.getValue().size() == 1 && e.getValue().getFirst().first().equals(m))
|
||||
.map(Map.Entry::getKey)
|
||||
.findFirst();
|
||||
subscriptionId.ifPresent(this::unsubscribeReceive);
|
||||
|
|
|
@ -42,7 +42,7 @@ public class Util {
|
|||
if (strings.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
return strings.get(0) + strings.stream()
|
||||
return strings.getFirst() + strings.stream()
|
||||
.skip(1)
|
||||
.filter(s -> !s.isEmpty())
|
||||
.map(s -> Character.toUpperCase(s.charAt(0)) + s.substring(1).toLowerCase(Locale.ROOT))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue