Class ConfigOptionParser

java.lang.Object
com.tngtech.jgiven.report.config.ConfigOptionParser

public class ConfigOptionParser extends Object
  • Constructor Details

    • ConfigOptionParser

      public ConfigOptionParser()
  • Method Details

    • getValue

      public Object getValue(ConfigOption co)
      Parameters:
      co - the configuration option to search for
      Returns:
      returns a castable object
    • generate

      public Map<String,Object> generate(List<ConfigOption> configList, String... args)
      Parses the configuration list and tries to create a mapping of the corresponding objects from the command line, properties or environment variables As long as the StringConverter are implemented with a null as fail and a working conversion the mapped objects are always in a correct state and castable to their representation
      Parameters:
      configList - the configuration list by which to search for the objects
      args - command line arguments
      Returns:
      returns the map of config.longName keys and corresponding castable objects
    • getFormat

      public static ReportGenerator.Format getFormat(String... args)
      Terminates with a help message if the parse is not successful
      Parameters:
      args - command line arguments to
      Returns:
      the format in a correct state
    • printUsageAndExit

      public void printUsageAndExit(List<ConfigOption> configOptions)
      Creates a help message based on the descriptions of the ConfigOption and terminates
      Parameters:
      configOptions - the configuration options of the report