Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-848

Improve StringUtils.is(Not)Blank with a CharSequence... version

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1
    • 3.2
    • lang.*
    • None

    Description

      Currently it's only possible to compare a single CharSequence per is(Not)Blank/is(Not)Empty call.

      This should be changed to support multiple CharSequences in a single call.

      if(StringUtils.isNotBlank(foo) && StringUtils.isNotBlank(bar) && ...)
      

      could be changed to

      if(StringUtils.isNotBlank(foo, bar, ...)
      

      As there are two possible ways to combine the results (AND and OR), it'd be necessary to create multiple methods.

      isAnyBlank(CharSequence... cs)
      isNoneBlank(CharSequence... cs)
      isAnyEmpty(CharSequence... cs)
      isNoneEmpty(CharSequence... cs)
      

      I could implement those methods and contribute them via github if there is any interest from project's side.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              amuthmann Alexander Muthmann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: