[
https://issues.apache.org/jira/browse/LANG-1732?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17842674#comment-17842674
]
Gary D. Gregory commented on LANG-1732:
---------------------------------------
You can just let the compiler unbox the result for you, it will NEVER be null,
or explicitly call {{booleanValue()}}.
Alternatively, you can toString() the Integer and pass it to
{{BooleanUtils.toBoolean(String)}}, or call {{inValue()}} and then
{{BooleanUtils.toBoolean(int)}}.
Adding an API here might not be worth the extra clutter.
> Add a function to convert a Integer object to boolean value
> -----------------------------------------------------------
>
> Key: LANG-1732
> URL: https://issues.apache.org/jira/browse/LANG-1732
> Project: Commons Lang
> Issue Type: New Feature
> Reporter: Jongjin Bae
> Priority: Major
>
> I need a function to convert a Integer object to boolean value.
> If the Integer object is null, the function returns boolean value it received
> as an argument.
> How about supporting this function in org.apache.commons.lang3.BooleanUtils
> class?
> I will implement this function, if it looks good.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)