Class Options

java.lang.Object
org.flasby.cli.Options

public class Options extends Object
Author:
flasbyst
  • Constructor Details

    • Options

      public Options(Options copy)
    • Options

      public Options(Message messages, String mlsPrefix)
  • Method Details

    • getMlsKey

      public String getMlsKey(String qualifier)
      returns a new MLS key with the qualifier appended to the prefix defined for this instance. This is useful to quickly obtain NLS keys which are specific to this Options instance.
      Parameters:
      qualifier -
      Returns:
    • addOption

      public Option addOption(Option option)
      add a new Option to this option collection.
      Returns:
      the option to allow for command chaining.
    • addOption

      public OptionList addOption(OptionList option)
    • addOption

      public Flag addOption(Flag option)
    • getOptions

      public Option[] getOptions()
      returns the options set on this collection of options.
      Returns:
    • usage

      public String usage()
      returns a string suitable for showing to the user as a usage description.
      Returns:
      the usage string.
    • create

      public Option create(char option, String descriptionKey)
      create an option which is not mandatory and has no defailt value.
      Parameters:
      option -
      descriptionKey -
      Returns:
    • create

      public Option create(char option, String descriptionKey, String defaultValue)
      create an option which is optional and has a default value.
      Parameters:
      option -
      descriptionKey -
      defaultValue -
      Returns:
    • create

      public Option create(char option, String descriptionKey, boolean isMandatory)
      create a new option with control over if the option must be specified. This only makes sense if te option is mandatory as you can create option ones usig other methods.
      Parameters:
      option -
      descriptionKey -
      isMandatory -
      Returns:
    • createList

      public OptionList createList(char option, String descriptionKey)
      create a new option list. Option lists are used where an option can have multiple values.
      Parameters:
      option -
      descriptionKey -
      Returns:
    • createList

      public OptionList createList(char option, String descriptionKey, boolean isMandatory)
    • create

      public OptionList create(String descriptionKey)
    • create

      public OptionList create(String descriptionKey, boolean isMandatory)
    • create

      public OptionList create(String descriptionKey, String defaultValue)
    • create

      public OptionList create(String descriptionKey, boolean isMandatory, String defaultValue)
    • createFlag

      public Flag createFlag(char flag, String descriptionKey)
    • getMessageBundle

      public Message getMessageBundle()
    • toString

      public String toString()
      Overrides:
      toString in class Object