Yes, that would be a good change.

The general goal of String conversions was to mimic the type's toString() and valueOf() methods, but there are some exceptions that are left over from OFBiz. I tried to remove the OFBiz-specific code when I ported the code to Commons, but I can see I missed a few spots.

Another general goal was to make conversions bidirectional:

Type A -> Type B -> Type A.

So, the Boolean converters need some work.

-Adrian

On 8/5/2013 6:16 AM, Gary Gregory wrote:
HI All:

This is for the string to Boolean converter, but I suppose this applies to
other converters.

Would providing an alternate string for "true" be in the spirit of
[convert]? What about for "false"?

The current converter would be enhanced to support this, the alt strings
would be provided in the ctor.

What is the thinking WRT to validation? For example I want a boolean
converter that throws an exception if the string is not "true" or "false"
(ignoring case). Would this be more appropriate in a
"ValidatingStringToBooleanConverter" instead of an extra setting in the
ctor?

Gary



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to