Class CheckCommand<T extends Configuration>

Type Parameters:
T - the Configuration subclass which is loaded from the configuration file

public class CheckCommand<T extends Configuration> extends ConfiguredCommand<T>
Parses and validates the application's configuration.
  • Constructor Details

    • CheckCommand

      public CheckCommand(Application<T> application)
  • Method Details

    • getConfigurationClass

      protected Class<T> getConfigurationClass()
      Description copied from class: ConfiguredCommand
      Returns the Class of the configuration type.
      Overrides:
      getConfigurationClass in class ConfiguredCommand<T extends Configuration>
      Returns:
      the Class of the configuration type
    • run

      protected void run(Bootstrap<T> bootstrap, net.sourceforge.argparse4j.inf.Namespace namespace, T configuration) throws Exception
      Description copied from class: ConfiguredCommand
      Runs the command with the given Bootstrap and Configuration.
      Specified by:
      run in class ConfiguredCommand<T extends Configuration>
      Parameters:
      bootstrap - the bootstrap
      namespace - the parsed command line namespace
      configuration - the configuration object
      Throws:
      Exception - if something goes wrong
    • onError

      public void onError(Cli cli, net.sourceforge.argparse4j.inf.Namespace namespace, Throwable e)
      Description copied from class: Command
      Method is called if there is an issue parsing configuration, setting up the environment, or running the command itself. The default is printing the stacktrace to facilitate debugging, but can be customized per command.
      Overrides:
      onError in class Command
      Parameters:
      cli - contains the streams for stdout and stderr
      namespace - the parsed arguments from the commandline
      e - The exception that was thrown when setting up or running the command