Re: [lang] Appetite for new method StringUtils.toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)

2017-06-05 Thread Amey Jadiye
+1

I like the way of implementation, I think we should have class in Commons
text CaseUtils.toCamelCase(String str, char delimiter, boolean
capitalizeFirstLetter)
Also this can have api for snake case (not sure if java need it)

@chtompki , If you wish I will submit code for review.

Regards,
Amey

On Jun 5, 2017 3:45 PM, "Benedikt Ritter"  wrote:

> Hi,
>
> > 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.
>
> Regards,
> Benedikt
>
> >
> > Cheers,
> > -Rob
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > For additional commands, e-mail: dev-h...@commons.apache.org
> >
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


Re: [lang] Appetite for new method StringUtils.toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)

2017-06-05 Thread Benedikt Ritter
Hi,

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

Regards,
Benedikt

> 
> Cheers,
> -Rob
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
> 


-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [lang] Appetite for new method StringUtils.toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)

2017-06-01 Thread Rob Tompkins


> On Jun 1, 2017, at 11:38 AM, Duncan Jones  wrote:
> 
>> On Thu, 1 Jun 2017 at 16:31, Amey Jadiye  wrote:
>> 
>> +1 seems good to have in toolbox. pretty similar method I have seen in
>> Commons text WordUtils.capitalize() almost similar logic we will need here
>> ,just not to capitalize first word and join them all, I'm in favour of
>> having this in WordUtils.
> 
> 
> We've discussed deprecating WorldUtils once the wrapping methods are broken
> out into separate classes. I'm in favour of an individual class to do this
> work.

Sure. Seems reasonable.

> 
> 
>> 
>> Regards,
>> Amey
>> 
>>> On Thu, Jun 1, 2017, 7:33 PM Rob Tompkins  wrote:
>>> 
>>> 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?
>>> 
>>> Cheers,
>>> -Rob
>>> -
>>> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
>>> For additional commands, e-mail: dev-h...@commons.apache.org
>>> 
>>> 
>> 

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [lang] Appetite for new method StringUtils.toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)

2017-06-01 Thread Duncan Jones
On Thu, 1 Jun 2017 at 16:31, Amey Jadiye  wrote:

> +1 seems good to have in toolbox. pretty similar method I have seen in
> Commons text WordUtils.capitalize() almost similar logic we will need here
> ,just not to capitalize first word and join them all, I'm in favour of
> having this in WordUtils.


We've discussed deprecating WorldUtils once the wrapping methods are broken
out into separate classes. I'm in favour of an individual class to do this
work.


>
> Regards,
> Amey
>
> On Thu, Jun 1, 2017, 7:33 PM Rob Tompkins  wrote:
>
> > 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?
> >
> > Cheers,
> > -Rob
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > For additional commands, e-mail: dev-h...@commons.apache.org
> >
> >
>


Re: [lang] Appetite for new method StringUtils.toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)

2017-06-01 Thread Matt Sicker
I like the idea. I've written similar code in a log4j2 branch for
normalizing configuration property names into camel case names.

On 1 June 2017 at 10:31, Amey Jadiye  wrote:

> +1 seems good to have in toolbox. pretty similar method I have seen in
> Commons text WordUtils.capitalize() almost similar logic we will need here
> ,just not to capitalize first word and join them all, I'm in favour of
> having this in WordUtils.
>
> Regards,
> Amey
>
> On Thu, Jun 1, 2017, 7:33 PM Rob Tompkins  wrote:
>
> > 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?
> >
> > Cheers,
> > -Rob
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > For additional commands, e-mail: dev-h...@commons.apache.org
> >
> >
>



-- 
Matt Sicker 


Re: [lang] Appetite for new method StringUtils.toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)

2017-06-01 Thread Amey Jadiye
+1 seems good to have in toolbox. pretty similar method I have seen in
Commons text WordUtils.capitalize() almost similar logic we will need here
,just not to capitalize first word and join them all, I'm in favour of
having this in WordUtils.

Regards,
Amey

On Thu, Jun 1, 2017, 7:33 PM Rob Tompkins  wrote:

> 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?
>
> Cheers,
> -Rob
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


Re: [lang] Appetite for new method StringUtils.toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)

2017-06-01 Thread Rob Tompkins

> On Jun 1, 2017, at 10:58 AM, Roger Whitcomb <roger.whitc...@actian.com> wrote:
> 
> I have a similar method in our code -- the use case is to take user input 
> (plain English field names, for instance) and turn it into variable names for 
> DTOs (or similar).
> 
> Another use we have for it is taking Java format ENUM_NAMES and turning them 
> into camelCaseVariableNames for things like dynamic property sheets.

This is quite similar to what we are doing as well.

and @Gary - I like both ideas, WordUtils or CamelCaseUtils.

-Rob

> 
> ~Roger Whitcomb
> 
> -Original Message-
> From: Duncan Jones [mailto:dun...@wortharead.com] 
> Sent: Thursday, June 01, 2017 7:32 AM
> To: Commons Developers List <dev@commons.apache.org>
> Subject: Re: [lang] Appetite for new method StringUtils.toCamelCase(String 
> str, char delimiter, boolean capitalizeFirstLetter)
> 
> On Thu, 1 Jun 2017 at 15:27, Gary Gregory <garydgreg...@gmail.com> wrote:
> 
>> IMO camel casing is all about words so [text] WordUtils. But why not 
>> have a CamelCaseUtils instead?
>> 
>> Gary
> 
> 
> +1. IMO it belongs in TEXT (if anywhere) and we should avoid classes 
> +with
> static methods.
> 
> Per our other conservation about case conversions, we should carefully 
> specify whether this uses upper- or title-case and how it behaves in 
> different locales.
> 
> OOI, what is your real world use case for this?
> 
> Duncan
> 
> 
>> 
>> On Jun 1, 2017 7:14 AM, "Rob Tompkins" <chtom...@gmail.com> wrote:
>> 
>>> 
>>>> On Jun 1, 2017, at 10:11 AM, Gary Gregory <garydgreg...@gmail.com>
>>> wrote:
>>>> 
>>>> Isn't this kind of stuff or anything camel case supposed to be in
>> [text]
>>> 
>>> I’m ok with that path as well. It feels like it’s on the line 
>>> between the two components. Either way, it sounds like you’re not 
>>> opposed to adding
>> it
>>> to a component.
>>> 
>>> Should it be TextUtils.toCamelCase(String str, char delimiter, 
>>> boolean capitalizeFirstLetter), or WordUtils maybe, if we were to 
>>> put it in
>> [text]?
>>> 
>>> -Rob
>>> 
>>>> these days?
>>>> 
>>>> Gary
>>>> 
>>>> On Jun 1, 2017 7:03 AM, "Rob Tompkins" <chtom...@gmail.com> wrote:
>>>> 
>>>>> 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?
>>>>> 
>>>>> Cheers,
>>>>> -Rob
>>>>> -
>>>>>  To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
>>>>> For additional commands, e-mail: dev-h...@commons.apache.org
>>>>> 
>>>>> 
>>> 
>>> 
>>> 
>>> - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
>>> For additional commands, e-mail: dev-h...@commons.apache.org
>>> 
>>> 
>> 
> 
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



RE: [lang] Appetite for new method StringUtils.toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)

2017-06-01 Thread Roger Whitcomb
I have a similar method in our code -- the use case is to take user input 
(plain English field names, for instance) and turn it into variable names for 
DTOs (or similar).

Another use we have for it is taking Java format ENUM_NAMES and turning them 
into camelCaseVariableNames for things like dynamic property sheets.

~Roger Whitcomb

-Original Message-
From: Duncan Jones [mailto:dun...@wortharead.com] 
Sent: Thursday, June 01, 2017 7:32 AM
To: Commons Developers List <dev@commons.apache.org>
Subject: Re: [lang] Appetite for new method StringUtils.toCamelCase(String str, 
char delimiter, boolean capitalizeFirstLetter)

On Thu, 1 Jun 2017 at 15:27, Gary Gregory <garydgreg...@gmail.com> wrote:

> IMO camel casing is all about words so [text] WordUtils. But why not 
> have a CamelCaseUtils instead?
>
> Gary


+1. IMO it belongs in TEXT (if anywhere) and we should avoid classes 
+with
static methods.

Per our other conservation about case conversions, we should carefully specify 
whether this uses upper- or title-case and how it behaves in different locales.

OOI, what is your real world use case for this?

Duncan


>
> On Jun 1, 2017 7:14 AM, "Rob Tompkins" <chtom...@gmail.com> wrote:
>
> >
> > > On Jun 1, 2017, at 10:11 AM, Gary Gregory <garydgreg...@gmail.com>
> > wrote:
> > >
> > > Isn't this kind of stuff or anything camel case supposed to be in
> [text]
> >
> > I’m ok with that path as well. It feels like it’s on the line 
> > between the two components. Either way, it sounds like you’re not 
> > opposed to adding
> it
> > to a component.
> >
> > Should it be TextUtils.toCamelCase(String str, char delimiter, 
> > boolean capitalizeFirstLetter), or WordUtils maybe, if we were to 
> > put it in
> [text]?
> >
> > -Rob
> >
> > > these days?
> > >
> > > Gary
> > >
> > > On Jun 1, 2017 7:03 AM, "Rob Tompkins" <chtom...@gmail.com> wrote:
> > >
> > >> 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?
> > >>
> > >> Cheers,
> > >> -Rob
> > >> -
> > >>  To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > >> For additional commands, e-mail: dev-h...@commons.apache.org
> > >>
> > >>
> >
> >
> > 
> > - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > For additional commands, e-mail: dev-h...@commons.apache.org
> >
> >
>

-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org


Re: [lang] Appetite for new method StringUtils.toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)

2017-06-01 Thread Duncan Jones
On Thu, 1 Jun 2017 at 15:27, Gary Gregory  wrote:

> IMO camel casing is all about words so [text] WordUtils. But why not have a
> CamelCaseUtils instead?
>
> Gary


+1. IMO it belongs in TEXT (if anywhere) and we should avoid classes with
static methods.

Per our other conservation about case conversions, we should carefully
specify whether this uses upper- or title-case and how it behaves in
different locales.

OOI, what is your real world use case for this?

Duncan


>
> On Jun 1, 2017 7:14 AM, "Rob Tompkins"  wrote:
>
> >
> > > On Jun 1, 2017, at 10:11 AM, Gary Gregory 
> > wrote:
> > >
> > > Isn't this kind of stuff or anything camel case supposed to be in
> [text]
> >
> > I’m ok with that path as well. It feels like it’s on the line between the
> > two components. Either way, it sounds like you’re not opposed to adding
> it
> > to a component.
> >
> > Should it be TextUtils.toCamelCase(String str, char delimiter, boolean
> > capitalizeFirstLetter), or WordUtils maybe, if we were to put it in
> [text]?
> >
> > -Rob
> >
> > > these days?
> > >
> > > Gary
> > >
> > > On Jun 1, 2017 7:03 AM, "Rob Tompkins"  wrote:
> > >
> > >> 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?
> > >>
> > >> Cheers,
> > >> -Rob
> > >> -
> > >> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > >> For additional commands, e-mail: dev-h...@commons.apache.org
> > >>
> > >>
> >
> >
> > -
> > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> > For additional commands, e-mail: dev-h...@commons.apache.org
> >
> >
>


Re: [lang] Appetite for new method StringUtils.toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)

2017-06-01 Thread Gary Gregory
IMO camel casing is all about words so [text] WordUtils. But why not have a
CamelCaseUtils instead?

Gary

On Jun 1, 2017 7:14 AM, "Rob Tompkins"  wrote:

>
> > On Jun 1, 2017, at 10:11 AM, Gary Gregory 
> wrote:
> >
> > Isn't this kind of stuff or anything camel case supposed to be in [text]
>
> I’m ok with that path as well. It feels like it’s on the line between the
> two components. Either way, it sounds like you’re not opposed to adding it
> to a component.
>
> Should it be TextUtils.toCamelCase(String str, char delimiter, boolean
> capitalizeFirstLetter), or WordUtils maybe, if we were to put it in [text]?
>
> -Rob
>
> > these days?
> >
> > Gary
> >
> > On Jun 1, 2017 7:03 AM, "Rob Tompkins"  wrote:
> >
> >> 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?
> >>
> >> Cheers,
> >> -Rob
> >> -
> >> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> >> For additional commands, e-mail: dev-h...@commons.apache.org
> >>
> >>
>
>
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


Re: [lang] Appetite for new method StringUtils.toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)

2017-06-01 Thread Rob Tompkins

> On Jun 1, 2017, at 10:11 AM, Gary Gregory  wrote:
> 
> Isn't this kind of stuff or anything camel case supposed to be in [text]

I’m ok with that path as well. It feels like it’s on the line between the two 
components. Either way, it sounds like you’re not opposed to adding it to a 
component.

Should it be TextUtils.toCamelCase(String str, char delimiter, boolean 
capitalizeFirstLetter), or WordUtils maybe, if we were to put it in [text]?

-Rob

> these days?
> 
> Gary
> 
> On Jun 1, 2017 7:03 AM, "Rob Tompkins"  wrote:
> 
>> 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?
>> 
>> Cheers,
>> -Rob
>> -
>> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
>> For additional commands, e-mail: dev-h...@commons.apache.org
>> 
>> 


-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org



Re: [lang] Appetite for new method StringUtils.toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)

2017-06-01 Thread Gary Gregory
Isn't this kind of stuff or anything camel case supposed to be in [text]
these days?

Gary

On Jun 1, 2017 7:03 AM, "Rob Tompkins"  wrote:

> 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?
>
> Cheers,
> -Rob
> -
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


[lang] Appetite for new method StringUtils.toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)

2017-06-01 Thread 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?

Cheers,
-Rob
-
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org