public class ArgumentBuilder extends Object
Constructor and Description |
---|
ArgumentBuilder()
Creates a new ArgumentBuilder instance
|
Modifier and Type | Method and Description |
---|---|
Argument |
create()
Creates a new Argument instance using the options specified in this
ArgumentBuilder.
|
ArgumentBuilder |
reset()
Resets the ArgumentBuilder to the defaults for a new Argument.
|
ArgumentBuilder |
withConsumeRemaining(String newConsumeRemaining)
Sets the "consume remaining" option, defaults to "--".
|
ArgumentBuilder |
withDefault(Object defaultValue)
Sets the default value.
|
ArgumentBuilder |
withDefaults(List newDefaultValues)
Sets the default values.
|
ArgumentBuilder |
withDescription(String newDescription)
Sets the description of the argument.
|
ArgumentBuilder |
withId(int newId)
Sets the id
|
ArgumentBuilder |
withInitialSeparator(char newInitialSeparator)
Sets the character used to separate the values from the option.
|
ArgumentBuilder |
withMaximum(int newMaximum)
Sets the maximum number of values allowed for the argument to be valid.
|
ArgumentBuilder |
withMinimum(int newMinimum)
Sets the minimum number of values needed for the argument to be valid.
|
ArgumentBuilder |
withName(String newName)
Sets the name of the argument.
|
ArgumentBuilder |
withSubsequentSeparator(char newSubsequentSeparator)
Sets the character used to separate the values from each other.
|
ArgumentBuilder |
withValidator(Validator newValidator)
Sets the validator instance used to perform validation on the Argument
values.
|
public ArgumentBuilder()
public final Argument create()
public final ArgumentBuilder reset()
public final ArgumentBuilder withName(String newName)
newName
- the name of the argumentCommandLine.getValue(String)
public final ArgumentBuilder withDescription(String newDescription)
newDescription
- a description of the argumentpublic final ArgumentBuilder withMinimum(int newMinimum)
newMinimum
- the number of values neededpublic final ArgumentBuilder withMaximum(int newMaximum)
newMaximum
- the number of values allowedpublic final ArgumentBuilder withInitialSeparator(char newInitialSeparator)
newInitialSeparator
- the character used to separate the values
from the optionpublic final ArgumentBuilder withSubsequentSeparator(char newSubsequentSeparator)
newSubsequentSeparator
- the character used to separate the values
from each otherpublic final ArgumentBuilder withValidator(Validator newValidator)
newValidator
- a Validator instancepublic final ArgumentBuilder withConsumeRemaining(String newConsumeRemaining)
newConsumeRemaining
- the string to use for the consume
remaining optionpublic final ArgumentBuilder withDefault(Object defaultValue)
defaultValue
- the default value for the Argumentpublic final ArgumentBuilder withDefaults(List newDefaultValues)
newDefaultValues
- the default values for the Argumentpublic final ArgumentBuilder withId(int newId)
newId
- the id of the ArgumentCopyright © 2002-2013 The Apache Software Foundation. All Rights Reserved.