Package com.tngtech.jgiven.report.config
Class ConfigOptionParser
- java.lang.Object
-
- com.tngtech.jgiven.report.config.ConfigOptionParser
-
public class ConfigOptionParser extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ConfigOptionParser()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>
generate(java.util.List<ConfigOption> configList, java.lang.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 theStringConverter
are implemented with a null as fail and a working conversion the mapped objects are always in a correct state and castable to their representationstatic ReportGenerator.Format
getFormat(java.lang.String... args)
Terminates with a help message if the parse is not successfuljava.lang.Object
getValue(ConfigOption co)
void
printUsageAndExit(java.util.List<ConfigOption> configOptions)
Creates a help message based on the descriptions of theConfigOption
and terminates
-
-
-
Method Detail
-
getValue
public java.lang.Object getValue(ConfigOption co)
- Parameters:
co
- the configuration option to search for- Returns:
- returns a castable object
-
generate
public java.util.Map<java.lang.String,java.lang.Object> generate(java.util.List<ConfigOption> configList, java.lang.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 theStringConverter
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 objectsargs
- command line arguments- Returns:
- returns the map of config.longName keys and corresponding castable objects
-
getFormat
public static ReportGenerator.Format getFormat(java.lang.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(java.util.List<ConfigOption> configOptions)
Creates a help message based on the descriptions of theConfigOption
and terminates- Parameters:
configOptions
- the configuration options of the report
-
-