commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hendrik Maryns <>
Subject Re: [CLI] Trouble with generifying Commons CLI §2: what are the values?
Date Tue, 14 Oct 2008 14:25:35 GMT
Emmanuel Bourg schreef:
> Hendrik Maryns a écrit :
>> Here, one problem is the getValue() method and its relatives.  It is not
>> possible to derive from the context which type of value it is supposed
>> to return.  The method getValue() itself returns an object, but all
>> usage examples I have seen until now return Strings and even more, there
>> are even classes where it *can* be deduced that it will always return a
>> String.  So my question is: why doesn’t getValue() return a String, and
>> should getValues() return a List<String> or a List<Object>?  I think
>> latter would be unfortunate.
> I guess the intent is to return more than a simple String, for example a
> File, a Number or an URL. So the only solution is to return a List of
> Objects.

I think you’re right, and I regret it.  This is an indication the API
should be altered such that this kind of type information does not occur.

Are there CLI developers here that want to discuss the issue?

Hendrik Maryns
Ask smart questions, get good answers:

View raw message