Interface ICommandExecutor

All Known Implementing Classes:
AbstractCommandExecutor, AbstractConvertSubcommand.AbstractConversionCommandExecutor, AbstractValidateContentCommand.AbstractValidationCommandExecutor
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface 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

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    This functional interface represents a method that is used to execute a command operation.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Execute the command operation.
    using(CallingContext callingContext, org.apache.commons.cli.CommandLine commandLine, ICommandExecutor.ExecutionFunction function)
    Create a new command executor.
  • Method Details

    • execute

      void execute() throws CommandExecutionException
      Execute the command operation.
      Throws:
      CommandExecutionException - if an error occurred while executing the command operation
    • using

      @NonNull static ICommandExecutor using(@NonNull 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 execution
      commandLine - the parsed command line details
      function - a function that accepts a calling context and command line information
      Returns:
      the executor instance