package catuml.presentation.command;

import java.util.function.Supplier;

/**
 * Base interface for all commands.
 */
@FunctionalInterface
public interface Command {

    void execute();

    default boolean canExecute() {
        return true;
    }

    static Command delegate(Command command) {
        return new CommandDelegate(command);
    }

    static Command delegate(Command command, Supplier<Boolean> canExecuteFunc) {
        return new CommandDelegate(command, canExecuteFunc);
    }

}
