Interface ICommandExecutor
- All Known Implementing Classes:
AbstractCommandExecutor
public interface ICommandExecutor
An abstract base class that implements the
ICommandExecutor
interface, providing common functionality for command execution
implementations. Concrete subclasses must implement the execute()
method to define specific command behavior.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
This functional interface represents a method that is used to execute a command operation. -
Method Summary
Modifier and TypeMethodDescriptionvoid
execute()
Execute the command operation.static ICommandExecutor
using
(CLIProcessor.CallingContext callingContext, org.apache.commons.cli.CommandLine commandLine, ICommandExecutor.ExecutionFunction function) Create a new command executor.
-
Method Details
-
execute
Execute the command operation.- Throws:
CommandExecutionException
- if an error occurred while executing the command operation
-
using
@NonNull static ICommandExecutor using(@NonNull CLIProcessor.CallingContext callingContext, @NonNull org.apache.commons.cli.CommandLine commandLine, @NonNull ICommandExecutor.ExecutionFunction function) Create a new command executor.- Parameters:
callingContext
- the context of the command executioncommandLine
- the parsed command line detailsfunction
- a function that accepts a calling context and command line information- Returns:
- the executor instance
-