signal-cli/src/main/java/org/asamk/signal/commands/JsonRpcCommand.java
AsamK a8bbdb54d0 Implement jsonRpc command
Co-authored-by: technillogue <technillogue@gmail.com>

Closes #668
2021-08-10 18:16:50 +02:00

22 lines
559 B
Java

package org.asamk.signal.commands;
import com.fasterxml.jackson.core.type.TypeReference;
import org.asamk.signal.OutputType;
import org.asamk.signal.commands.exceptions.CommandException;
import org.asamk.signal.manager.Manager;
import java.util.Set;
public interface JsonRpcCommand<T> extends Command {
default TypeReference<T> getRequestType() {
return null;
}
void handleCommand(T request, Manager m) throws CommandException;
default Set<OutputType> getSupportedOutputTypes() {
return Set.of(OutputType.JSON);
}
}