Class ProgramArguments

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  ProgramArguments.Option
      JOSM command line options.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<ProgramArguments.Option,​java.util.List<java.lang.String>> argMap  
    • Constructor Summary

      Constructors 
      Constructor Description
      ProgramArguments​(java.lang.String... args)
      Construct the program arguments object
    • Constructor Detail

      • ProgramArguments

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

      • buildCommandLineArgumentMap

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

        public java.util.Optional<java.lang.String> getSingle​(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.
      • get

        public java.util.Collection<java.lang.String> get​(ProgramArguments.Option option)
        Gets all values that are given for a given option
        Parameters:
        option - The option
        Returns:
        The values that were given. May be empty.
      • 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 java.util.logging.Level getLogLevel()
        Get the log level the user wants us to use.
        Returns:
        The log level.
      • getPreferencesToSet

        public java.util.Map<java.lang.String,​java.lang.String> getPreferencesToSet()
        Gets a map of all preferences the user wants to set.
        Returns:
        The preferences to set. It contains null values for preferences to unset
      • getValue

        private static java.lang.String getValue​(java.lang.String... kv)