@PublicEvolving public class Option extends Object
Modifier and Type | Method and Description |
---|---|
Option |
alt(String shortName)
Define an alternative / short name of the parameter.
|
Option |
choices(String... choices)
Restrict the list of possible values of the parameter.
|
Option |
defaultValue(String defaultValue)
Define a default value for the option.
|
String |
getAlt() |
Set<String> |
getChoices() |
String |
getDefaultValue() |
String |
getHelpText() |
String |
getName() |
OptionType |
getType() |
boolean |
hasAlt() |
boolean |
hasDefaultValue() |
boolean |
hasType() |
Option |
help(String helpText)
Add a help text, explaining the parameter.
|
boolean |
isCastableToDefinedType(String value) |
Option |
type(OptionType type)
Define the type of the Option.
|
public Option(String name)
public Option alt(String shortName)
shortName
- - short version of the parameter namepublic Option type(OptionType type)
type
- - the type which the the value of the Option can be casted to.public Option defaultValue(String defaultValue) throws RequiredParametersException
defaultValue
- - the default valueRequiredParametersException
public Option choices(String... choices) throws RequiredParametersException
choices
- - the allowed values of the parameter.RequiredParametersException
public Option help(String helpText)
helpText
- - the help text.public String getName()
public boolean hasAlt()
public boolean hasType()
public OptionType getType()
public String getAlt()
public String getHelpText()
public boolean hasDefaultValue()
public String getDefaultValue()
public boolean isCastableToDefinedType(String value)
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.