Package com.tngtech.jgiven.report.config
Class ConfigOptionBuilder
- java.lang.Object
-
- com.tngtech.jgiven.report.config.ConfigOptionBuilder
-
public class ConfigOptionBuilder extends java.lang.Object
An easier interface to createConfigOption
for use withAbstractReportGenerator
-
-
Constructor Summary
Constructors Constructor Description ConfigOptionBuilder(java.lang.String longName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigOption
build()
ConfigOptionBuilder
setCommandLineOptionWithArgument(CommandLineOption commandLineOption, StringConverter converter)
if you want to parse an argument, you need a converter from String to ObjectConfigOptionBuilder
setCommandLineOptionWithoutArgument(CommandLineOption commandLineOption, java.lang.Object value)
if you don't have an argument, choose the value that is going to be inserted into the map insteadConfigOptionBuilder
setDefaultWith(java.lang.Object defaultValue)
if you have a default, it's automatically optionalConfigOptionBuilder
setDescription(java.lang.String description)
ConfigOptionBuilder
setEnvironmentString(java.lang.String envString, StringConverter converter)
ConfigOptionBuilder
setOptional()
if the option is optional, you don't have to use itConfigOptionBuilder
setPropertyString(java.lang.String propertyString, StringConverter converter)
ConfigOptionBuilder
setShortName(java.lang.String shortName)
ConfigOptionBuilder
setStringConverter(StringConverter converter)
if you want to convert some string to an object, you have an argument to parse
-
-
-
Method Detail
-
setShortName
public ConfigOptionBuilder setShortName(java.lang.String shortName)
-
setCommandLineOptionWithArgument
public ConfigOptionBuilder setCommandLineOptionWithArgument(CommandLineOption commandLineOption, StringConverter converter)
if you want to parse an argument, you need a converter from String to Object- Parameters:
commandLineOption
- specification of the command line optionsconverter
- how to convert your String value to a castable Object
-
setCommandLineOptionWithoutArgument
public ConfigOptionBuilder setCommandLineOptionWithoutArgument(CommandLineOption commandLineOption, java.lang.Object value)
if you don't have an argument, choose the value that is going to be inserted into the map instead- Parameters:
commandLineOption
- specification of the command line optionsvalue
- the value that is going to be inserted into the map instead of the argument
-
setPropertyString
public ConfigOptionBuilder setPropertyString(java.lang.String propertyString, StringConverter converter)
-
setEnvironmentString
public ConfigOptionBuilder setEnvironmentString(java.lang.String envString, StringConverter converter)
-
setDescription
public ConfigOptionBuilder setDescription(java.lang.String description)
-
setOptional
public ConfigOptionBuilder setOptional()
if the option is optional, you don't have to use it
-
setDefaultWith
public ConfigOptionBuilder setDefaultWith(java.lang.Object defaultValue)
if you have a default, it's automatically optional
-
setStringConverter
public ConfigOptionBuilder setStringConverter(StringConverter converter)
if you want to convert some string to an object, you have an argument to parse
-
build
public ConfigOption build()
-
-