Refactor command creation

This commit is contained in:
AsamK 2021-08-20 18:42:38 +02:00
parent 47143a90e1
commit af292d8f0e
45 changed files with 436 additions and 282 deletions

View file

@ -2,6 +2,7 @@ package org.asamk.signal.commands;
import net.sourceforge.argparse4j.inf.Namespace;
import org.asamk.signal.OutputWriter;
import org.asamk.signal.commands.exceptions.CommandException;
import org.asamk.signal.manager.Manager;
@ -9,10 +10,14 @@ import java.util.List;
public interface MultiLocalCommand extends LocalCommand {
void handleCommand(Namespace ns, List<Manager> m, final SignalCreator c) throws CommandException;
void handleCommand(
Namespace ns, List<Manager> m, SignalCreator c, OutputWriter outputWriter
) throws CommandException;
@Override
default void handleCommand(final Namespace ns, final Manager m) throws CommandException {
handleCommand(ns, List.of(m), null);
default void handleCommand(
final Namespace ns, final Manager m, final OutputWriter outputWriter
) throws CommandException {
handleCommand(ns, List.of(m), null, outputWriter);
}
}