This repository has been archived on 2021-12-05. You can view files and clone it, but cannot push or open issues or pull requests.
envoy/client/src/main/java/envoy/client/data/commands/Callable.java

40 lines
1.1 KiB
Java

package envoy.client.data.commands;
import java.util.List;
/**
* This interface defines an action that should be performed when a system
* command gets called.
*
* @author Leon Hofmeister
* @since Envoy Client v0.2-beta
*/
public interface Callable {
/**
* Performs the instance specific action when a {@link SystemCommand} has been
* called.
*
* @param arguments the arguments that should be passed to the
* {@link SystemCommand}
* @since Envoy Client v0.2-beta
*/
void call(List<String> arguments);
/**
* Performs the instance specific action when a {@link SystemCommand} has been
* called and additionally enables the user to execute his own action once it
* has been called.
*
* @param arguments the arguments that should be passed to the
* {@link SystemCommand}
* @param additionalAction the action to perform when this system command has
* been called
* @since Envoy Client v0.2-beta
*/
default void call(List<String> arguments, Runnable additionalAction) {
call(arguments);
additionalAction.run();
}
}