Interface CommandRegistration.Builder

All Known Implementing Classes:
CommandRegistration.BaseBuilder, CommandRegistration.DefaultBuilder
Enclosing interface:
CommandRegistration

public static interface CommandRegistration.Builder
Builder interface for CommandRegistration.
  • Method Details

    • command

      CommandRegistration.Builder command(String... commands)
      Define commands this registration uses. Essentially defines a full set of main and sub commands. It doesn't matter if full command is defined in one string or multiple strings as "words" are splitted and trimmed with whitespaces. You will get result of command subcommand1 subcommand2, ....
      Parameters:
      commands - the commands
      Returns:
      builder for chaining
    • interactionMode

      Define InteractionMode for a command.
      Parameters:
      mode - the interaction mode
      Returns:
      builder for chaining
    • description

      CommandRegistration.Builder description(String description)
      Define a description text for a command.
      Parameters:
      description - the description text
      Returns:
      builder for chaining
    • availability

      CommandRegistration.Builder availability(Supplier<Availability> availability)
      Define an Availability suppliear for a command.
      Parameters:
      availability - the availability
      Returns:
      builder for chaining
    • group

      Define a group for a command.
      Parameters:
      group - the group
      Returns:
      builder for chaining
    • hidden

      Define a command to be hidden.
      Returns:
      builder for chaining
      See Also:
    • hidden

      CommandRegistration.Builder hidden(boolean hidden)
      Define a command to be hidden by a given flag.
      Parameters:
      hidden - the hidden flag
      Returns:
      builder for chaining
    • defaultOptionNameModifier

      CommandRegistration.Builder defaultOptionNameModifier(Function<String,String> modifier)
      Provides a global option name modifier. Will be used with all options to modify long names. Usual use case is to enforce naming convention i.e. to have snake-case for all names.
      Parameters:
      modifier - to modifier to change option name
      Returns:
      builder for chaining
    • withOption

      Define an option what this command should user for. Can be used multiple times.
      Returns:
      option spec for chaining
    • withTarget

      Define a target what this command should execute
      Returns:
      target spec for chaining
    • withAlias

      Define an alias what this command should execute
      Returns:
      alias spec for chaining
    • withExitCode

      Define an exit code what this command should execute
      Returns:
      exit code spec for chaining
    • withErrorHandling

      Define an error handling what this command should use
      Returns:
      error handling spec for chaining
    • withHelpOptions

      Define help options what this command should use.
      Returns:
      help options spec for chaining
    • build

      Returns:
      a command registration