You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Dexter Fryar (JIRA)" <ji...@apache.org> on 2012/10/26 20:57:13 UTC

[jira] [Created] (LANG-847) Add an isTrue and isFalse method to StringUtils

Dexter Fryar created LANG-847:
---------------------------------

             Summary: Add an isTrue and isFalse method to StringUtils
                 Key: LANG-847
                 URL: https://issues.apache.org/jira/browse/LANG-847
             Project: Commons Lang
          Issue Type: Improvement
    Affects Versions: 3.x
            Reporter: Dexter Fryar
            Priority: Trivial
         Attachments: StringUtils.java.patchfile, StringUtilsTest.java.patchfile

Implement a common list of true / false statements with a helper method which cleans and validates an input string.

StringUtils.isFalse("OFF")
StringUtils.isFalse("false")
StringUtils.isFalse("   false    ")
StringUtils.isFalse("false\n")
StringUtils.isFalse("  false\r\n  ")
StringUtils.isFalse("  0\r\n  ")
StringUtils.isFalse("disable")
StringUtils.isFalse("  disable\r\n  ")
StringUtils.isFalse("disabled")
StringUtils.isFalse("  disabled\r\n  ")
StringUtils.isFalse("N")
StringUtils.isFalse(" N\n  ")
StringUtils.isFalse("NO")
StringUtils.isFalse("NO\r\n  ")

StringUtils.isTrue("ON")
StringUtils.isTrue("true")
StringUtils.isTrue("   true    ")
StringUtils.isTrue("true\n")
StringUtils.isTrue("  true\r\n  ")
StringUtils.isTrue("  1\r\n  ")
StringUtils.isTrue("enable")
StringUtils.isTrue("  enable\r\n  ")
StringUtils.isTrue("enabled")
StringUtils.isTrue("  enabled\r\n  ")
StringUtils.isTrue("Y")
StringUtils.isTrue(" Y\n  ")
StringUtils.isTrue("YES")
StringUtils.isTrue("YES\r\n  ")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (LANG-847) Add an isTrue and isFalse method to StringUtils

Posted by "James Ring (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485232#comment-13485232 ] 

James Ring commented on LANG-847:
---------------------------------

I don't think this is appropriate for a general-purpose lib like Commons Lang. It's hard to see a burning need for something like this.
                
> Add an isTrue and isFalse method to StringUtils
> -----------------------------------------------
>
>                 Key: LANG-847
>                 URL: https://issues.apache.org/jira/browse/LANG-847
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 3.x
>            Reporter: Dexter Fryar
>            Priority: Trivial
>         Attachments: StringUtils.java.patchfile, StringUtilsTest.java.patchfile
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Implement a common list of true / false statements with a helper method which cleans and validates an input string.
> StringUtils.isFalse("OFF")
> StringUtils.isFalse("false")
> StringUtils.isFalse("   false    ")
> StringUtils.isFalse("false\n")
> StringUtils.isFalse("  false\r\n  ")
> StringUtils.isFalse("  0\r\n  ")
> StringUtils.isFalse("disable")
> StringUtils.isFalse("  disable\r\n  ")
> StringUtils.isFalse("disabled")
> StringUtils.isFalse("  disabled\r\n  ")
> StringUtils.isFalse("N")
> StringUtils.isFalse(" N\n  ")
> StringUtils.isFalse("NO")
> StringUtils.isFalse("NO\r\n  ")
> StringUtils.isTrue("ON")
> StringUtils.isTrue("true")
> StringUtils.isTrue("   true    ")
> StringUtils.isTrue("true\n")
> StringUtils.isTrue("  true\r\n  ")
> StringUtils.isTrue("  1\r\n  ")
> StringUtils.isTrue("enable")
> StringUtils.isTrue("  enable\r\n  ")
> StringUtils.isTrue("enabled")
> StringUtils.isTrue("  enabled\r\n  ")
> StringUtils.isTrue("Y")
> StringUtils.isTrue(" Y\n  ")
> StringUtils.isTrue("YES")
> StringUtils.isTrue("YES\r\n  ")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (LANG-847) Add an isTrue and isFalse method to StringUtils

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485747#comment-13485747 ] 

Sebb commented on LANG-847:
---------------------------

I agree: this is out of scope.
                
> Add an isTrue and isFalse method to StringUtils
> -----------------------------------------------
>
>                 Key: LANG-847
>                 URL: https://issues.apache.org/jira/browse/LANG-847
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 3.x
>            Reporter: Dexter Fryar
>            Priority: Trivial
>         Attachments: StringUtils.java.patchfile, StringUtilsTest.java.patchfile
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Implement a common list of true / false statements with a helper method which cleans and validates an input string.
> StringUtils.isFalse("OFF")
> StringUtils.isFalse("false")
> StringUtils.isFalse("   false    ")
> StringUtils.isFalse("false\n")
> StringUtils.isFalse("  false\r\n  ")
> StringUtils.isFalse("  0\r\n  ")
> StringUtils.isFalse("disable")
> StringUtils.isFalse("  disable\r\n  ")
> StringUtils.isFalse("disabled")
> StringUtils.isFalse("  disabled\r\n  ")
> StringUtils.isFalse("N")
> StringUtils.isFalse(" N\n  ")
> StringUtils.isFalse("NO")
> StringUtils.isFalse("NO\r\n  ")
> StringUtils.isTrue("ON")
> StringUtils.isTrue("true")
> StringUtils.isTrue("   true    ")
> StringUtils.isTrue("true\n")
> StringUtils.isTrue("  true\r\n  ")
> StringUtils.isTrue("  1\r\n  ")
> StringUtils.isTrue("enable")
> StringUtils.isTrue("  enable\r\n  ")
> StringUtils.isTrue("enabled")
> StringUtils.isTrue("  enabled\r\n  ")
> StringUtils.isTrue("Y")
> StringUtils.isTrue(" Y\n  ")
> StringUtils.isTrue("YES")
> StringUtils.isTrue("YES\r\n  ")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (LANG-847) Add an isTrue and isFalse method to StringUtils

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/LANG-847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485304#comment-13485304 ] 

Gary Gregory commented on LANG-847:
-----------------------------------

This feels out of scope. What about other languages?
                
> Add an isTrue and isFalse method to StringUtils
> -----------------------------------------------
>
>                 Key: LANG-847
>                 URL: https://issues.apache.org/jira/browse/LANG-847
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 3.x
>            Reporter: Dexter Fryar
>            Priority: Trivial
>         Attachments: StringUtils.java.patchfile, StringUtilsTest.java.patchfile
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Implement a common list of true / false statements with a helper method which cleans and validates an input string.
> StringUtils.isFalse("OFF")
> StringUtils.isFalse("false")
> StringUtils.isFalse("   false    ")
> StringUtils.isFalse("false\n")
> StringUtils.isFalse("  false\r\n  ")
> StringUtils.isFalse("  0\r\n  ")
> StringUtils.isFalse("disable")
> StringUtils.isFalse("  disable\r\n  ")
> StringUtils.isFalse("disabled")
> StringUtils.isFalse("  disabled\r\n  ")
> StringUtils.isFalse("N")
> StringUtils.isFalse(" N\n  ")
> StringUtils.isFalse("NO")
> StringUtils.isFalse("NO\r\n  ")
> StringUtils.isTrue("ON")
> StringUtils.isTrue("true")
> StringUtils.isTrue("   true    ")
> StringUtils.isTrue("true\n")
> StringUtils.isTrue("  true\r\n  ")
> StringUtils.isTrue("  1\r\n  ")
> StringUtils.isTrue("enable")
> StringUtils.isTrue("  enable\r\n  ")
> StringUtils.isTrue("enabled")
> StringUtils.isTrue("  enabled\r\n  ")
> StringUtils.isTrue("Y")
> StringUtils.isTrue(" Y\n  ")
> StringUtils.isTrue("YES")
> StringUtils.isTrue("YES\r\n  ")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (LANG-847) Add an isTrue and isFalse method to StringUtils

Posted by "Dexter Fryar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dexter Fryar updated LANG-847:
------------------------------

    Component/s: lang.*
    
> Add an isTrue and isFalse method to StringUtils
> -----------------------------------------------
>
>                 Key: LANG-847
>                 URL: https://issues.apache.org/jira/browse/LANG-847
>             Project: Commons Lang
>          Issue Type: Improvement
>          Components: lang.*
>    Affects Versions: 3.x
>            Reporter: Dexter Fryar
>            Priority: Trivial
>         Attachments: StringUtils.java.patchfile, StringUtilsTest.java.patchfile
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Implement a common list of true / false statements with a helper method which cleans and validates an input string.
> StringUtils.isFalse("OFF")
> StringUtils.isFalse("false")
> StringUtils.isFalse("   false    ")
> StringUtils.isFalse("false\n")
> StringUtils.isFalse("  false\r\n  ")
> StringUtils.isFalse("  0\r\n  ")
> StringUtils.isFalse("disable")
> StringUtils.isFalse("  disable\r\n  ")
> StringUtils.isFalse("disabled")
> StringUtils.isFalse("  disabled\r\n  ")
> StringUtils.isFalse("N")
> StringUtils.isFalse(" N\n  ")
> StringUtils.isFalse("NO")
> StringUtils.isFalse("NO\r\n  ")
> StringUtils.isTrue("ON")
> StringUtils.isTrue("true")
> StringUtils.isTrue("   true    ")
> StringUtils.isTrue("true\n")
> StringUtils.isTrue("  true\r\n  ")
> StringUtils.isTrue("  1\r\n  ")
> StringUtils.isTrue("enable")
> StringUtils.isTrue("  enable\r\n  ")
> StringUtils.isTrue("enabled")
> StringUtils.isTrue("  enabled\r\n  ")
> StringUtils.isTrue("Y")
> StringUtils.isTrue(" Y\n  ")
> StringUtils.isTrue("YES")
> StringUtils.isTrue("YES\r\n  ")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (LANG-847) Add an isTrue and isFalse method to StringUtils

Posted by "Dexter Fryar (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LANG-847?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dexter Fryar updated LANG-847:
------------------------------

    Attachment: StringUtilsTest.java.patchfile
                StringUtils.java.patchfile

Added two patch files that contain junit and source.
                
> Add an isTrue and isFalse method to StringUtils
> -----------------------------------------------
>
>                 Key: LANG-847
>                 URL: https://issues.apache.org/jira/browse/LANG-847
>             Project: Commons Lang
>          Issue Type: Improvement
>    Affects Versions: 3.x
>            Reporter: Dexter Fryar
>            Priority: Trivial
>         Attachments: StringUtils.java.patchfile, StringUtilsTest.java.patchfile
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Implement a common list of true / false statements with a helper method which cleans and validates an input string.
> StringUtils.isFalse("OFF")
> StringUtils.isFalse("false")
> StringUtils.isFalse("   false    ")
> StringUtils.isFalse("false\n")
> StringUtils.isFalse("  false\r\n  ")
> StringUtils.isFalse("  0\r\n  ")
> StringUtils.isFalse("disable")
> StringUtils.isFalse("  disable\r\n  ")
> StringUtils.isFalse("disabled")
> StringUtils.isFalse("  disabled\r\n  ")
> StringUtils.isFalse("N")
> StringUtils.isFalse(" N\n  ")
> StringUtils.isFalse("NO")
> StringUtils.isFalse("NO\r\n  ")
> StringUtils.isTrue("ON")
> StringUtils.isTrue("true")
> StringUtils.isTrue("   true    ")
> StringUtils.isTrue("true\n")
> StringUtils.isTrue("  true\r\n  ")
> StringUtils.isTrue("  1\r\n  ")
> StringUtils.isTrue("enable")
> StringUtils.isTrue("  enable\r\n  ")
> StringUtils.isTrue("enabled")
> StringUtils.isTrue("  enabled\r\n  ")
> StringUtils.isTrue("Y")
> StringUtils.isTrue(" Y\n  ")
> StringUtils.isTrue("YES")
> StringUtils.isTrue("YES\r\n  ")

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira