Class CommandLine


  • public class CommandLine
    extends Object
    The parser transforms a CLI (a model) into an CommandLine. This CommandLine has stored the argument and option values. Only instance of parser should create objects of this type.

    NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

    • Constructor Detail

      • CommandLine

        public CommandLine​(io.vertx.core.cli.CommandLine delegate)
      • CommandLine

        public CommandLine​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.core.cli.CommandLine getDelegate()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • create

        public static CommandLine create​(CLI cli)
        Parameters:
        cli - the CLI definition
        Returns:
        the command line object
      • cli

        public CLI cli()
        Returns:
        the model of this command line object.
      • allArguments

        public List<String> allArguments()
        Returns:
        the ordered list of arguments. Arguments are command line arguments not matching an option.
      • getOptionValue

        public <T> T getOptionValue​(String name)
        Parameters:
        name - the name
        Returns:
        the value, null if not set
      • getArgumentValue

        public <T> T getArgumentValue​(String name)
        Parameters:
        name - the name
        Returns:
        the value, null if not set
      • getArgumentValue

        public <T> T getArgumentValue​(int index)
        Parameters:
        index - the index
        Returns:
        the value, null if not set
      • isFlagEnabled

        public boolean isFlagEnabled​(String name)
        Parameters:
        name - the option name
        Returns:
        true if the flag has been set in the command line, false otherwise.
      • isOptionAssigned

        public boolean isOptionAssigned​(io.vertx.core.cli.Option option)
        Parameters:
        option - the option
        Returns:
        true if the option has received a value, otherwise.
      • getRawValuesForOption

        public List<String> getRawValuesForOption​(io.vertx.core.cli.Option option)
        Parameters:
        option - the option
        Returns:
        the list of values, empty if none
      • getRawValuesForArgument

        public List<String> getRawValuesForArgument​(io.vertx.core.cli.Argument argument)
        Parameters:
        argument - the argument
        Returns:
        the list of values, empty if none
      • getRawValueForOption

        public String getRawValueForOption​(io.vertx.core.cli.Option option)
        Parameters:
        option - the option
        Returns:
        the value, null if none.
      • acceptMoreValues

        public boolean acceptMoreValues​(io.vertx.core.cli.Option option)
        Parameters:
        option - the option
        Returns:
        if the option accepts more values, otherwise.
      • getRawValueForArgument

        public String getRawValueForArgument​(io.vertx.core.cli.Argument arg)
        Parameters:
        arg - the argument
        Returns:
        the value, null if none.
      • isArgumentAssigned

        public boolean isArgumentAssigned​(io.vertx.core.cli.Argument arg)
        Parameters:
        arg - the argument
        Returns:
        true if the argument has received a value, otherwise.
      • isSeenInCommandLine

        public boolean isSeenInCommandLine​(io.vertx.core.cli.Option option)
        Parameters:
        option - the option
        Returns:
        true if the user command line has used the option
      • isValid

        public boolean isValid()
        Returns:
        true if the current CommandLine object is valid. otherwise.
      • isAskingForHelp

        public boolean isAskingForHelp()
        Returns:
        true if the user command line has enabled a "Help" option, otherwise.
      • newInstance

        public static CommandLine newInstance​(io.vertx.core.cli.CommandLine arg)