commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (LANG-1257) Add APIs StringUtils.wrapIfMissing(String, char|String)
Date Tue, 16 Aug 2016 15:16:20 GMT

     [ https://issues.apache.org/jira/browse/LANG-1257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Gary Gregory updated LANG-1257:
-------------------------------
    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.

  was:
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.


> Add APIs StringUtils.wrapIfMissing(String, char|String)
> -------------------------------------------------------
>
>                 Key: LANG-1257
>                 URL: https://issues.apache.org/jira/browse/LANG-1257
>             Project: Commons Lang
>          Issue Type: New Feature
>          Components: lang.*
>            Reporter: Gary Gregory
>            Assignee: Gary Gregory
>             Fix For: 3.5
>
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message