public class SwitchBuilder extends java.lang.Object
| Constructor and Description |
|---|
SwitchBuilder()
Creates a new SwitchBuilder using defaults.
|
SwitchBuilder(java.lang.String enabledPrefix,
java.lang.String disabledPrefix)
Creates a new SwitchBuilder
|
| Modifier and Type | Method and Description |
|---|---|
Switch |
create()
Creates a new Switch instance
|
SwitchBuilder |
reset()
Resets the builder.
|
SwitchBuilder |
withArgument(Argument newArgument)
Use this Argument
|
SwitchBuilder |
withChildren(Group newChildren)
Use this child Group
|
SwitchBuilder |
withDescription(java.lang.String newDescription)
Use this option description
|
SwitchBuilder |
withId(int newId)
Sets the id
|
SwitchBuilder |
withName(java.lang.String name)
Use this option name.
|
SwitchBuilder |
withRequired(boolean newRequired)
Use this optionality
|
SwitchBuilder |
withSwitchDefault(java.lang.Boolean newSwitchDefault)
Sets the default state for this switch
|
public SwitchBuilder()
public SwitchBuilder(java.lang.String enabledPrefix, java.lang.String disabledPrefix) throws java.lang.IllegalArgumentException
enabledPrefix - the prefix to use for enabling the optiondisabledPrefix - the prefix to use for disabling the optionjava.lang.IllegalArgumentException - if either prefix is less than 1
character long or the prefixes matchpublic SwitchBuilder reset()
public SwitchBuilder withDescription(java.lang.String newDescription)
newDescription - the description to usepublic SwitchBuilder withName(java.lang.String name)
name - the name to usepublic SwitchBuilder withRequired(boolean newRequired)
newRequired - true iff the Option is requiredpublic SwitchBuilder withArgument(Argument newArgument)
newArgument - the argument to usepublic SwitchBuilder withChildren(Group newChildren)
newChildren - the child Group to usepublic final SwitchBuilder withId(int newId)
newId - the id of the Switchpublic final SwitchBuilder withSwitchDefault(java.lang.Boolean newSwitchDefault)
newSwitchDefault - the default state