commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benedikt Ritter <>
Subject Re: [lang] Appetite for new method StringUtils.toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
Date Mon, 05 Jun 2017 10:15:33 GMT

> Am 01.06.2017 um 16:03 schrieb Rob Tompkins <>:
> Hello all,
> Folks at my day job have a method that takes in a space delimited String (or arbitrarily
delimited string for that matter), and returns a camel cased string. Is there any reason that
this shouldn’t be in StringUtils? It feels reasonable to me. What are folks thoughts?

Sorry to come late to this discussion. We should have a look at Guava’s CaseFormat class,
which das camel case conversion and more. I think that design should lead yours. 
I’ve come to the conclusion that anything that is more complex than StringUtils.isEmpty(String)
(e.g. needs more than one parameter) should not be implemented as a static util method. Such
a design always leads to procedural style coding which is an anti pattern IMHO.
CaseFormat is a nice example of how should an API can be build more OOP style.


> Cheers,
> -Rob
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message