Skip to content

default values

h908714124 edited this page Jul 7, 2021 · 10 revisions

jbock doesn't have a way to specify default values. The only "default values" it knows are Optional.empty(), OptionalInt.empty(), OptionalLong.empty() and OptionalDouble.empty().

(update 5.2: added io.vavr.control.Option)

In particular, jbock will not use a null default, and any type that isn't one of the Optional variants mentioned above represents a required option or parameter. When a required option is missing, the generated parse method will return a Left, rather than a command instance with "missing" properties.

See JCommander for an example.

Clone this wiki locally