mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 02:50:39 +00:00
Refactor command creation
This commit is contained in:
parent
47143a90e1
commit
af292d8f0e
45 changed files with 436 additions and 282 deletions
|
@ -10,14 +10,15 @@ import java.util.Map;
|
|||
|
||||
public class VersionCommand implements JsonRpcCommand<Void> {
|
||||
|
||||
private final OutputWriter outputWriter;
|
||||
|
||||
public VersionCommand(final OutputWriter outputWriter) {
|
||||
this.outputWriter = outputWriter;
|
||||
@Override
|
||||
public String getName() {
|
||||
return "version";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleCommand(final Void request, final Manager m) throws CommandException {
|
||||
public void handleCommand(
|
||||
final Void request, final Manager m, final OutputWriter outputWriter
|
||||
) throws CommandException {
|
||||
final var jsonWriter = (JsonWriter) outputWriter;
|
||||
jsonWriter.write(Map.of("version", BaseConfig.PROJECT_VERSION));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue