Minor maintenance on ToolTask classes
- Use default method on AutoToolTask interface in favor of abstract SimpleAutoTask class - Adjust the path in various .tpl.md files - Remove unused constant in ToolsConstants
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package tools.utils;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
* Interface for tasks that can be run automatically, i.e. without any user input.
|
||||
*/
|
||||
@@ -10,4 +12,9 @@ public interface AutoToolTask extends ToolTask {
|
||||
*/
|
||||
void executeDefault();
|
||||
|
||||
@Override
|
||||
default void execute(Scanner scanner) {
|
||||
executeDefault();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package tools.utils;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
/**
|
||||
* Abstract class for auto tool tasks that perform exactly the same action for
|
||||
* {@link ToolTask#execute(Scanner)} and {@link AutoToolTask#executeDefault()}.
|
||||
*/
|
||||
public abstract class SimpleAutoTask implements AutoToolTask {
|
||||
|
||||
@Override
|
||||
public final void execute(Scanner scanner) {
|
||||
executeDefault();
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,6 @@ public final class ToolsConstants {
|
||||
|
||||
public static final String MAIN_RESOURCES_ROOT = "src/main/resources/";
|
||||
|
||||
// Add specific `fr.xephi.authme` package as not to include the tool tasks in the `tools` package
|
||||
public static final String TEST_SOURCE_ROOT = "src/test/java/fr/xephi/authme";
|
||||
|
||||
public static final String TOOLS_SOURCE_ROOT = "src/test/java/tools/";
|
||||
|
||||
public static final String DOCS_FOLDER = "docs/";
|
||||
|
||||
Reference in New Issue
Block a user