vertx / io.vertx.core.cli / TypedArgument

TypedArgument

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.

Author
Clement Escoffier

Constructors

<init>

TypedArgument(arg: TypedArgument<T>)

Creates a new instance of TypedArgument by copying the state of another TypedArgument.

TypedArgument()

Creates an empty instance of TypedArgument.

Inherited Properties

DEFAULT_ARG_NAME

static val DEFAULT_ARG_NAME: String

The default argument name displayed in the usage.

Functions

ensureValidity

open fun ensureValidity(): Unit

Checks whether or not the argument configuration is valid. In addition of the check made by the parent class it ensures that the type is set. If the configuration is not valid, this method throws a IllegalArgumentException.

getConverter

open fun getConverter(): Converter<T>

getType

open fun getType(): Class<T>

setArgName

open fun setArgName(argName: String): TypedArgument<T>

setConverter

open fun setConverter(converter: Converter<T>): TypedArgument<T>

Sets the converter used to create the value.

setDefaultValue

open fun setDefaultValue(defaultValue: String): TypedArgument<T>

setDescription

open fun setDescription(description: String): TypedArgument<T>

setHidden

open fun setHidden(hidden: Boolean): TypedArgument<T>

setIndex

open fun setIndex(index: Int): TypedArgument<T>

setMultiValued

open fun setMultiValued(multiValued: Boolean): TypedArgument<T>

setRequired

open fun setRequired(required: Boolean): TypedArgument<T>

setType

open fun setType(type: Class<T>): TypedArgument<T>

Sets the argument type.

Inherited Functions

getArgName

open fun getArgName(): String

getDefaultValue

open fun getDefaultValue(): String

getDescription

open fun getDescription(): String

getIndex

open fun getIndex(): Int

isHidden

open fun isHidden(): Boolean

isMultiValued

open fun isMultiValued(): Boolean

isRequired

open fun isRequired(): Boolean

toJson

open fun toJson(): JsonObject

Exports this Argument to its corresponding JSON representation.