jcommander icon indicating copy to clipboard operation
jcommander copied to clipboard

Improve support for collections on default values

Open marcobjorge opened this issue 5 years ago • 0 comments

The previous interface for ´IDefaultProvider´ assumes that defaults have been represented as a String. Although this is ok for most cases, with Lists the String approach becomes harder to guarantee (e.g. unescaped split on comma) and with Maps it's not even supported. By having the ´IDefaultProvider´ return a List instead of a plain String simplifies the representation of default values for Lists (e.g. clean object [1, 2] instead of CSV String 1,2) and allows the representation of Maps (e.g. String a=b).

marcobjorge avatar Jun 12 '20 19:06 marcobjorge