|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.cli2.builder.SwitchBuilder
public class SwitchBuilder
Builds Switch instance.
Field Summary | |
---|---|
private java.util.Set |
aliases
|
private Argument |
argument
|
private Group |
children
|
private java.lang.String |
description
|
private java.lang.String |
disabledPrefix
|
private java.lang.String |
enabledPrefix
|
private int |
id
|
private java.lang.String |
preferredName
|
private boolean |
required
|
private java.lang.Boolean |
switchDefault
|
Constructor Summary | |
---|---|
SwitchBuilder()
Creates a new SwitchBuilder using defaults. |
|
SwitchBuilder(java.lang.String enabledPrefix,
java.lang.String disabledPrefix)
Creates a new SwitchBuilder |
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final java.lang.String enabledPrefix
private final java.lang.String disabledPrefix
private java.lang.String description
private java.lang.String preferredName
private java.util.Set aliases
private boolean required
private Argument argument
private Group children
private int id
private java.lang.Boolean switchDefault
Constructor Detail |
---|
public SwitchBuilder()
Switch.DEFAULT_ENABLED_PREFIX
,
Switch.DEFAULT_DISABLED_PREFIX
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 option
java.lang.IllegalArgumentException
- if either prefix is less than 1
character long or the prefixes matchMethod Detail |
---|
public Switch create()
public SwitchBuilder reset()
public SwitchBuilder withDescription(java.lang.String newDescription)
newDescription
- the description to use
public SwitchBuilder withName(java.lang.String name)
name
- the name to use
public SwitchBuilder withRequired(boolean newRequired)
newRequired
- true iff the Option is required
public SwitchBuilder withArgument(Argument newArgument)
newArgument
- the argument to use
public SwitchBuilder withChildren(Group newChildren)
newChildren
- the child Group to use
public final SwitchBuilder withId(int newId)
newId
- the id of the Switch
public final SwitchBuilder withSwitchDefault(java.lang.Boolean newSwitchDefault)
newSwitchDefault
- the default state
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |