Add StringUtils#isAllEmpty(CharSequence...) and isAllBlank(CharSequence...)?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Add StringUtils#isAllEmpty(CharSequence...) and isAllBlank(CharSequence...)?

Pascal Schumacher
Hello everybody,

a few months ago StringUtils#isAnyNotEmpty(CharSequence...) and
StringUtils#isAnyNotBlank(CharSequence...) were added
(https://issues.apache.org/jira/browse/LANG-1270).

Now there is a pull request which purposes adding the inverse of these
methods named isAllEmpty(CharSequence...) and
isAllBlank(CharSequence...)
(https://github.com/apache/commons-lang/pull/221)

Duncan Jones commented on the pull request: "I don't think we should add
methods that are simply the inverse of another method."

On the other hand similar method "pairs" already exist:
isEmpty/isNotEmpty, isBlank/isNotBlank, isAnyEmpty/isNoneEmpty,
containsAny/containsNone

What do you think, should we add these methods?

-Pascal



Reply | Threaded
Open this post in threaded view
|

Re: Add StringUtils#isAllEmpty(CharSequence...) and isAllBlank(CharSequence...)?

Bruno P. Kinoshita-3
Hello,

I'm 0 on that one. Agree that users can simply use the negation operator, and also that it can be handy to have a method to avoid typos or simplify their code.


Cheers
Bruno



----- Original Message -----
From: Pascal Schumacher <[hidden email]>
To: Commons Developers List <[hidden email]>
Sent: Monday, 13 February 2017 6:12 AM
Subject: Add StringUtils#isAllEmpty(CharSequence...) and isAllBlank(CharSequence...)?

Hello everybody,

a few months ago StringUtils#isAnyNotEmpty(CharSequence...) and
StringUtils#isAnyNotBlank(CharSequence...) were added
(https://issues.apache.org/jira/browse/LANG-1270).

Now there is a pull request which purposes adding the inverse of these
methods named isAllEmpty(CharSequence...) and
isAllBlank(CharSequence...)
(https://github.com/apache/commons-lang/pull/221)

Duncan Jones commented on the pull request: "I don't think we should add
methods that are simply the inverse of another method."

On the other hand similar method "pairs" already exist:
isEmpty/isNotEmpty, isBlank/isNotBlank, isAnyEmpty/isNoneEmpty,
containsAny/containsNone

What do you think, should we add these methods?

-Pascal

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]