Interface CommandOption

All Known Implementing Classes:
CommandOption.DefaultCommandOption

public interface CommandOption
Interface representing an option in a command.
  • Method Details

    • getLongNames

      String[] getLongNames()
      Gets a long names of an option.
      Returns:
      long names of an option
    • getLongNamesModified

      String[] getLongNamesModified()
      Gets a modified long names of an option. Set within a command registration if option name modifier were used to have an info about original names.
      Returns:
      modified long names of an option
    • getShortNames

      Character[] getShortNames()
      Gets a short names of an option.
      Returns:
      short names of an option
    • getDescription

      String getDescription()
      Gets a description of an option.
      Returns:
      description of an option
    • getType

      org.springframework.core.ResolvableType getType()
      Gets a ResolvableType of an option.
      Returns:
      type of an option
    • isRequired

      boolean isRequired()
      Gets a flag if option is required.
      Returns:
      the required flag
    • getDefaultValue

      String getDefaultValue()
      Gets a default value of an option.
      Returns:
      the default value
    • getPosition

      int getPosition()
      Gets a positional value.
      Returns:
      the positional value
    • getArityMin

      int getArityMin()
      Gets a minimum arity.
      Returns:
      the minimum arity
    • getArityMax

      int getArityMax()
      Gets a maximum arity.
      Returns:
      the maximum arity
    • getLabel

      String getLabel()
      Gets a label.
      Returns:
      the label
    • getCompletion

      CompletionResolver getCompletion()
      Gets a completion function.
      Returns:
      the completion function
    • of

      static CommandOption of(String[] longNames, Character[] shortNames, String description)
      Gets an instance of a default CommandOption.
      Parameters:
      longNames - the long names
      shortNames - the short names
      description - the description
      Returns:
      default command option
    • of

      static CommandOption of(String[] longNames, Character[] shortNames, String description, org.springframework.core.ResolvableType type)
      Gets an instance of a default CommandOption.
      Parameters:
      longNames - the long names
      shortNames - the short names
      description - the description
      type - the type
      Returns:
      default command option
    • of

      static CommandOption of(String[] longNames, String[] longNamesModified, Character[] shortNames, String description, org.springframework.core.ResolvableType type, boolean required, String defaultValue, Integer position, Integer arityMin, Integer arityMax, String label, CompletionResolver completion)
      Gets an instance of a default CommandOption.
      Parameters:
      longNames - the long names
      longNamesModified - the modified long names
      shortNames - the short names
      description - the description
      type - the type
      required - the required flag
      defaultValue - the default value
      position - the position value
      arityMin - the min arity
      arityMax - the max arity
      label - the label
      completion - the completion
      Returns:
      default command option