commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Läubrich (JIRA) <>
Subject [jira] [Created] (CLI-272) Make Option a generic class
Date Mon, 13 Mar 2017 10:21:04 GMT
Christoph Läubrich created CLI-272:

             Summary: Make Option a generic class
                 Key: CLI-272
             Project: Commons CLI
          Issue Type: Improvement
          Components: CLI-1.x, Options definition
    Affects Versions: 1.4
            Reporter: Christoph Läubrich

An Option can have a type (e.g. String, Number, ...) but this type can not automatically be
inferred later since Option is not generic.

It would be usefull to add a generic to the Option so the type can be inferred like Option<String>,
Option<Number> and so on.
The CommandLine can then have an 

<T> getParsedOptionValue(Option<T> opt)

method so type-safe fetching of Option values is possible without any (optimistic) casting
or typechecking is involved.

This message was sent by Atlassian JIRA

View raw message