类 CommandLineArgs

java.lang.Object
cn.taketoday.core.env.CommandLineArgs

final class CommandLineArgs extends Object
A simple representation of command line arguments, broken into "option arguments" and "non-option arguments".
从以下版本开始:
4.0
作者:
Chris Beams
另请参阅:
  • 字段详细资料

  • 构造器详细资料

    • CommandLineArgs

      CommandLineArgs()
  • 方法详细资料

    • addOptionArg

      public void addOptionArg(String optionName, @Nullable String optionValue)
      Add an option argument for the given option name and add the given value to the list of values associated with this option (of which there may be zero or more). The given value may be null, indicating that the option was specified without an associated value (e.g. "--foo" vs. "--foo=bar").
    • getOptionNames

      public Set<String> getOptionNames()
      Return the set of all option arguments present on the command line.
    • containsOption

      public boolean containsOption(String optionName)
      Return whether the option with the given name was present on the command line.
    • getOptionValues

      @Nullable public List<String> getOptionValues(String optionName)
      Return the list of values associated with the given option. null signifies that the option was not present; empty list signifies that no values were associated with this option.
    • addNonOptionArg

      public void addNonOptionArg(String value)
      Add the given value to the list of non-option arguments.
    • getNonOptionArgs

      public List<String> getNonOptionArgs()
      Return the list of non-option arguments specified on the command line.