Rename JsonRpcCommand class

This commit is contained in:
AsamK 2021-11-10 17:11:16 +01:00
parent 2879b31aba
commit 64af4914ee
5 changed files with 17 additions and 12 deletions

View file

@ -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);
}

View file

@ -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<>() {};

View file

@ -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;
}

View file

@ -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() {