Class ProgramArguments

    • Constructor Detail

      • ProgramArguments

        public ProgramArguments​(String... args)
        Construct the program arguments object
        Parameters:
        args - The args passed to main.
        Since:
        10936
    • Method Detail

      • buildCommandLineArgumentMap

        private void buildCommandLineArgumentMap​(String... args)
        Builds the command-line argument map.
        Parameters:
        args - command-line arguments array
      • getSingle

        public Optional<StringgetSingle​(ProgramArguments.Option option)
        Gets a single argument (the first) that was given for the given option.
        Parameters:
        option - The option to search
        Returns:
        The argument as optional value.
      • hasOption

        public boolean hasOption​(ProgramArguments.Option option)
        Test if a given option was used by the user.
        Parameters:
        option - The option to test for
        Returns:
        true if the user used it.
      • showVersion

        public boolean showVersion()
        Helper method to indicate if version should be displayed.
        Returns:
        true to display version
      • showHelp

        public boolean showHelp()
        Helper method to indicate if help should be displayed.
        Returns:
        true to display version
      • getLogLevel

        public Level getLogLevel()
        Get the log level the user wants us to use.
        Returns:
        The log level.
      • getPreferencesToSet

        public Map<String,​StringgetPreferencesToSet()
        Gets a map of all preferences the user wants to set.
        Returns:
        The preferences to set. It contains null values for preferences to unset