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

Add APIs StringUtils.wrapIfMissing(String, char|String)

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.5
    • lang.*
    • None

    Description

      Add APIs:

      • Add APIs StringUtils.wrapIfMissing(String, char)
      • Add APIs StringUtils.wrapIfMissing(String, String)

      Note: We already have:

      • StringUtils.wrap(String, char)
      • StringUtils.wrap(String, String)

      And we already use the "IfMissing" name segment in "appendIfMissing()" and "prependIfMissing()".

      Using "IfAbsent" would have been a better choice IMO since the JRE already uses "IfAbsent" in ConcurrentHashMap for example; but consistency is better here I think.

      Attachments

        Activity

          People

            ggregory Gary D. Gregory
            ggregory Gary D. Gregory
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: