public interface Apo_TypedC<T> extends ApoBaseTyped<T>, ApoBaseC
A standard typed CLI option.
| Modifier and Type | Method and Description |
|---|---|
default boolean |
cliArgIsOptional()
Returns the flag for an argument being optional or not.
|
String |
getCliArgumentDescription()
Returns a description of the CLI argument.
|
String |
getCliArgumentName()
Returns the name of the CLI argument.
|
T |
getCliValue()
Returns the CLI value of the option if any set.
|
default ST |
getHelp()
Returns help information for the option.
|
default T |
getValue()
Returns the value of the option.
|
default boolean |
isSet()
Tests if the option is set.
|
void |
setCliValue(Object value)
Sets the CLI value of the option.
|
default void |
validate()
Validates the option.
|
getDefaultValuecliIsRequired, getCliLong, getCliShort, getCliShortLong, inCli, setInCLigetDisplayName, getLongDescriptiongetDescriptiondefault boolean cliArgIsOptional()
Returns the flag for an argument being optional or not.
The default implementation is false.
String getCliArgumentDescription()
Returns a description of the CLI argument.
The CLI argument is the value that is expected with in the command line.
For instance, if the option is -h COMMAD there is a argument COMMAND expected from the command line.
This description then should explain what COMMAD is or what values can be used.
String getCliArgumentName()
Returns the name of the CLI argument.
For instance, if the option is -h COMMAD there is a argument COMMAND expected from the command line.
The name returned in this example should be COMMAND.
T getCliValue()
Returns the CLI value of the option if any set.
default ST getHelp()
ApoBaseReturns help information for the option. The information contains all possible settings, except the long description. This might include CLI, property, environment, and other settings.
default T getValue()
Returns the value of the option. First the CLI value is tested and if not null it is returned. Last the default value is returned.
getValue in interface ApoBaseTyped<T>default boolean isSet()
Tests if the option is set.
A typed option is set if it has a value that is not null.
isSet in interface ApoBaseisSet in interface ApoBaseTyped<T>void setCliValue(Object value) throws CliParseException, IllegalStateException
Sets the CLI value of the option.
value - the value read from the command line, must not be null (or blank in case of a string)CliParseException - if the argument was blank (string) or otherwise problematicIllegalStateException - if the argument was blank (string) or otherwise problematicdefault void validate()
throws IllegalStateException
ApoBaseValidates the option.
validate in interface ApoBasevalidate in interface ApoBaseCIllegalStateException - for any validation errorCopyright © 2016–2017. All rights reserved.