package com.nthportal.shell.async.compat;

import com.nthportal.shell.compat.Shell;

import java.util.List;
import java.util.function.Function;

@FunctionalInterface
public interface InputActionCreator {
    <T> InputAction<T> inputAction(Function<Shell, T> action);

    default InputAction<Void> execution(String line) {
        return inputAction(shell -> {
            shell.executeLine(line);
            return null;
        });
    }

    default InputAction<List<String>> tabCompletion(String line) {
        return inputAction(shell -> shell.tabComplete(line));
    }
}

@@ -138,16 +138,73 @@
 ction;%0A%0A
+/**%0A * Something which creates %7B@link InputAction%7Ds.%0A */%0A
 @Functio
@@ -262,241 +262,952 @@
     
-%3CT%3E InputAction%3CT%3E inputAction(Function%3CShell, T%3E action);%0A%0A    default InputAction%3CVoid%3E execution(String line) %7B%0A        return inputAction(shell -%3E %7B%0A            shell.executeLine(line);%0A            return null;%0A        %7D);%0A    %7D%0A
+/**%0A     * Creates a new %7B@link InputAction%7D with the given action%0A     *%0A     * @param action the action for the InputAction to perform%0A     * @param %3CT%3E the return type of the action%0A     * @return an InputAction for the given action%0A     */%0A    %3CT%3E InputAction%3CT%3E inputAction(Function%3CShell, T%3E action);%0A%0A    /**%0A     * Creates an %7B@link InputAction%7D for executing a line.%0A     *%0A     * @param line the line to be executed%0A     * @return an input action for executing the given line%0A     * @see Shell#executeLine(String)%0A     */%0A    default InputAction%3CVoid%3E execution(String line) %7B%0A        return inputAction(shell -%3E %7B%0A            shell.executeLine(line);%0A            return null;%0A        %7D);%0A    %7D%0A%0A    /**%0A     * Creates an %7B@link InputAction%7D for tab-completing a line.%0A     *%0A     * @param line the line to be tab-completed%0A     * @return an input action for tab-completing the given line%0A     * @see Shell#tabComplete(String)%0A     */
 %0A   

Add javadocs