@Retention(value=RUNTIME) @Target(value={FIELD,PARAMETER}) public @interface Option
Options can be particularly useful as an alternative to adding additional arguments in cases where backwards compatibility of a command signature needs to be maintained, but can also be used for execution that are optional and have a reasonable default value for most cases.
Modifier and Type | Required Element and Description |
---|---|
String |
longForm
The long form for the argument (e.g.
|
char |
shortForm
The short (switch e.g.
|
Modifier and Type | Optional Element and Description |
---|---|
String |
defaultValue
The option's default value.
|
String |
description
A brief description of the Option.
|
String |
displayName
Returns a display name for the option.
|
boolean |
hidden
Whether or not this option should be hidden.
|
boolean |
required
Whether or not the option is required.
|
String[] |
validOptions
Can be specified to limit the valid options.
|
public abstract char shortForm
public abstract String longForm
public abstract String displayName
This value can be used by user interfaces in place of
the actual option name. When this value is omitted,
the longForm()
can be used.
public abstract String description
public abstract String defaultValue
public abstract boolean required
public abstract boolean hidden
public abstract String[] validOptions
Copyright © 2019 Neeve Research, LLC. All Rights Reserved.