Class ConfigOptionBuilder

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

public class ConfigOptionBuilder extends Object
An easier interface to create ConfigOption for use with AbstractReportGenerator
  • Constructor Details

    • ConfigOptionBuilder

      public ConfigOptionBuilder(String longName)
  • Method Details

    • setShortName

      public ConfigOptionBuilder setShortName(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 options
      converter - how to convert your String value to a castable Object
    • setCommandLineOptionWithoutArgument

      public ConfigOptionBuilder setCommandLineOptionWithoutArgument(CommandLineOption commandLineOption, 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 options
      value - the value that is going to be inserted into the map instead of the argument
    • setPropertyString

      public ConfigOptionBuilder setPropertyString(String propertyString, StringConverter converter)
    • setEnvironmentString

      public ConfigOptionBuilder setEnvironmentString(String envString, StringConverter converter)
    • setDescription

      public ConfigOptionBuilder setDescription(String description)
    • setOptional

      public ConfigOptionBuilder setOptional()
      if the option is optional, you don't have to use it
    • setDefaultWith

      public ConfigOptionBuilder setDefaultWith(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()