[ https://issues.apache.org/jira/browse/LANG-1404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16542178#comment-16542178 ]
ASF GitHub Bot commented on LANG-1404: -------------------------------------- Github user coveralls commented on the issue: https://github.com/apache/commons-lang/pull/337 [![Coverage Status](https://coveralls.io/builds/17961981/badge)](https://coveralls.io/builds/17961981) Coverage increased (+0.0003%) to 95.244% when pulling **32c833822e51d362b08f6f5c8fa6ca42abd53bd6 on Enigo:LANG-1404_boolean_utils** into **c241b096d32f9ece918466f3614c143e8679dac5 on apache:master**. > BooleanUtils.toBoolean(Integer) method added > -------------------------------------------- > > Key: LANG-1404 > URL: https://issues.apache.org/jira/browse/LANG-1404 > Project: Commons Lang > Issue Type: Improvement > Components: lang.* > Reporter: Ruslan Sibgatullin > Priority: Minor > > Right now to convert an Integer to boolean there is either a null check > needed: > {{final Integer value = 1;}} > {{if (value != null) {}} > {{ if(BooleanUtils.toBoolean(value)) {}} > {{ // some code}} > } > {{}}} > or two methods call: > > {{final Integer value = 1;}} > {{final Boolean b = BooleanUtils.toBooleanObject(value);}} > {{if (BooleanUtils.toBoolean(b)) {}} > {{ // some code}} > {{}}} > Some code-sugar is added with the help of method that accepts Integer and > returns boolean: > {{final Integer value = 1;}} > {{if (BooleanUtils.toBoolean(value)) {}} > // some code > {{}}} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)