net.dpml.cli.builder
Class SwitchBuilder
java.lang.Object
net.dpml.cli.builder.SwitchBuilder
Builds Switch instance.
SwitchBuilder() - Creates a new SwitchBuilder using defaults.
|
SwitchBuilder(String enabledPrefix, String disabledPrefix) - Creates a new SwitchBuilder
|
SwitchBuilder
public SwitchBuilder()
Creates a new SwitchBuilder using defaults.
SwitchBuilder
public SwitchBuilder(String enabledPrefix,
String disabledPrefix)
throws IllegalArgumentException
Creates a new SwitchBuilder
enabledPrefix
- the prefix to use for enabling the optiondisabledPrefix
- the prefix to use for disabling the option
withDescription
public SwitchBuilder withDescription(String newDescription)
Use this option description
newDescription
- the description to use
withName
public SwitchBuilder withName(String name)
Use this option name. The first name is used as the preferred
display name for the Command and then later names are used as aliases.
withRequired
public SwitchBuilder withRequired(boolean newRequired)
Use this optionality
newRequired
- true iff the Option is required
withSwitchDefault
public final SwitchBuilder withSwitchDefault(Boolean newSwitchDefault)
Sets the default state for this switch
newSwitchDefault
- the default state