open class Argument
Defines a command line argument. Unlike options, argument don't have names and are identified using an index. The first index is 0 (because we are in the computer world).
Author
Clement Escoffier
See Also
Option
Argument()
Creates a new empty instance of Argument. Argument(other: Argument)
Creates a new instance of Argument by copying Argument(json: JsonObject)
Creates a new instance of Argument from the given JSON object. |
static val DEFAULT_ARG_NAME: String
The default argument name displayed in the usage. |
open fun ensureValidity(): Unit
Checks that the argument configuration is valid. This method is mainly made for children classes adding constraint to the configuration. The parser verifies that arguments are valid before starting the parsing. If the configuration is not valid, this method throws a IllegalArgumentException. |
|
open fun getArgName(): String |
|
open fun getDefaultValue(): String |
|
open fun getDescription(): String |
|
open fun getIndex(): Int |
|
open fun isHidden(): Boolean |
|
open fun isMultiValued(): Boolean |
|
open fun isRequired(): Boolean |
|
open fun setArgName(argName: String): Argument
Sets the argument name of this Argument. |
|
open fun setDefaultValue(defaultValue: String): Argument
Sets the default value of this Argument. |
|
open fun setDescription(description: String): Argument
Sets the description of the Argument. |
|
open fun setHidden(: Boolean): Argument
Sets whether or not the current Argument is hidden. |
|
open fun setIndex(index: Int): Argument
Sets the argument index. |
|
open fun setMultiValued(multiValued: Boolean): Argument
Sets whether or not the argument can receive several values. Only the last argument can receive several values. |
|
open fun setRequired(required: Boolean): Argument
Sets whether or not the current Argument is required. |
|
open fun toJson(): JsonObject
Exports this Argument to its corresponding JSON representation. |
open class TypedArgument<T : Any> : Argument
An implementation of Argument for java specifying the type of object received by the argument. This allows converting the given raw value into the specified type. |