agrison / jtoml

TOML for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Getter should return `boolean`, not `Boolean`.

adamv opened this issue · comments

Since the Getter throws if the value isn't convertible to a boolean, the interface should return lower-case boolean instead of nullable upper-case Boolean.

Do you want to avoid unboxing or calling manually Boolean.booleanValue() ?

If the parser can't match \w = (true|false) the value isn't stored into the context map, so the call to Toml.getBoolean() will throw an Exception because the key is not there (null is not instance of Boolean).

So yes, it's easy to return the primitive boolean value if found (value is not null), and throw an Exception if not (as it is already the case), but I wonder what would be the advantage of it put aside my first sentence. Could you explain ?

Thank you very much.
Alexandre