Skip to content

converter

h908714124 edited this page Aug 25, 2021 · 16 revisions

In the DeleteCommand example, the path parameter is required, while verbosity is optional. The @Parameter and @Option annotations do not have boolean attributes like required or optional. Instead, the multiplicity is determined by the parameter type.

Multiplicity table

(option|param) type Multiplicity Arity (if option)
boolean 0..1 (optional) nullary(*)
Optional<A> 0..1 (optional) unary
Optional{Int,Long,Double} 0..1 (optional) unary
List<A> 0..* (repeatable) unary
A (exact match) 1 (required) unary

where A must be one of the auto types, otherwise compilation will fail.

(*) only available when the converter Attribute is not set

Clone this wiki locally