org.jline.console.CommandMethods Maven / Gradle / Ivy
The newest version!
/*
* Copyright (c) 2002-2020, the original author(s).
*
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* https://opensource.org/licenses/BSD-3-Clause
*/
package org.jline.console;
import java.util.List;
import java.util.function.Consumer;
import java.util.function.Function;
import org.jline.reader.Completer;
public class CommandMethods {
Function execute;
Function> compileCompleter;
public CommandMethods(Function execute, Function> compileCompleter) {
this.execute = execute;
this.compileCompleter = compileCompleter;
}
public CommandMethods(Consumer execute, Function> compileCompleter) {
this.execute = (CommandInput i) -> {
execute.accept(i);
return null;
};
this.compileCompleter = compileCompleter;
}
public Function execute() {
return execute;
}
public Function> compileCompleter() {
return compileCompleter;
}
}