mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 02:50:39 +00:00
Rename JsonRpcCommand class
This commit is contained in:
parent
2879b31aba
commit
64af4914ee
5 changed files with 17 additions and 12 deletions
|
@ -3,9 +3,6 @@ package org.asamk.signal.commands;
|
|||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
|
||||
import org.asamk.signal.OutputType;
|
||||
import org.asamk.signal.OutputWriter;
|
||||
import org.asamk.signal.commands.exceptions.CommandException;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -15,8 +12,6 @@ public interface JsonRpcCommand<T> extends Command {
|
|||
return null;
|
||||
}
|
||||
|
||||
void handleCommand(T request, Manager m, OutputWriter outputWriter) throws CommandException;
|
||||
|
||||
default List<OutputType> getSupportedOutputTypes() {
|
||||
return List.of(OutputType.JSON);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ import org.asamk.signal.manager.Manager;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface JsonRpcLocalCommand extends JsonRpcCommand<Map<String, Object>>, LocalCommand {
|
||||
public interface JsonRpcLocalCommand extends JsonRpcSingleCommand<Map<String, Object>>, LocalCommand {
|
||||
|
||||
default TypeReference<Map<String, Object>> getRequestType() {
|
||||
return new TypeReference<>() {};
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package org.asamk.signal.commands;
|
||||
|
||||
import org.asamk.signal.OutputWriter;
|
||||
import org.asamk.signal.commands.exceptions.CommandException;
|
||||
import org.asamk.signal.manager.Manager;
|
||||
|
||||
public interface JsonRpcSingleCommand<T> extends JsonRpcCommand<T> {
|
||||
|
||||
void handleCommand(T request, Manager m, OutputWriter outputWriter) throws CommandException;
|
||||
}
|
|
@ -8,7 +8,7 @@ import org.asamk.signal.manager.Manager;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
public class VersionCommand implements JsonRpcCommand<Void> {
|
||||
public class VersionCommand implements JsonRpcSingleCommand<Void> {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue