Re: [lang] Considering a new String utility class

2023-03-20 Thread Xeno Amess
Otherwise I doubt the cost... From: Xeno Amess Sent: Monday, March 20, 2023 7:00:14 PM To: Commons Developers List Subject: Re: [lang] Considering a new String utility class I agree if it doesn't hurt more than 5% performance

Re: [lang] Considering a new String utility class

2023-03-20 Thread Xeno Amess
I agree if it doesn't hurt more than 5% performance. From: Peter Verhas Sent: Monday, March 20, 2023 4:16:17 PM To: Commons Developers List Subject: Re: [lang] Considering a new String utility class A few years ago when I refactored some code in this project, I

Re: [lang] Considering a new String utility class

2023-03-20 Thread Peter Verhas
A few years ago when I refactored some code in this project, I created such a class for myself, as I was experimenting at that time with how to generate fluent API automatically. I will look it up where it is and give here a pointer. That may be a starting point and as you can guessed from the

Re: [lang] Considering a new String utility class

2023-03-16 Thread Gary Gregory
Yes, an enum is better than a mystery boolean. Gary On Thu, Mar 16, 2023, 00:18 Matt Benson wrote: > On Wed, Mar 15, 2023 at 11:10 PM Hasan Diwan > wrote: > > > On Wed, 15 Mar 2023 at 20:55, Matt Benson wrote: > > > > > > > > > Any thoughts? > > > > > > > Something like: > > > > >

Re: [lang] Considering a new String utility class

2023-03-16 Thread Matt Benson
On Thu, Mar 16, 2023, 3:15 AM Hasan Diwan wrote: > Looking through StringUtils[1]m most of the methods have an "IgnoreCase" > variant, so I don't think one needs to DO anything to achieve this. If you > want to fold the ignoreCase variants, add something like: > > private static boolean

Re: [lang] Considering a new String utility class

2023-03-16 Thread Hasan Diwan
Looking through StringUtils[1]m most of the methods have an "IgnoreCase" variant, so I don't think one needs to DO anything to achieve this. If you want to fold the ignoreCase variants, add something like: private static boolean disregardCase = false; /** * Sets case-insensitivity in

Re: [lang] Considering a new String utility class

2023-03-15 Thread Matt Benson
On Wed, Mar 15, 2023 at 11:10 PM Hasan Diwan wrote: > On Wed, 15 Mar 2023 at 20:55, Matt Benson wrote: > > > > > > > Any thoughts? > > > > Something like: > > > StringUtils2.ignoreCase() /* makes the next functions case insensitive > */.respectCase(). * back to case-sensitive */ > > What about

Re: [lang] Considering a new String utility class

2023-03-15 Thread Hasan Diwan
On Wed, 15 Mar 2023 at 20:55, Matt Benson wrote: > > > > > Any thoughts? > Something like: > StringUtils2.ignoreCase() /* makes the next functions case insensitive */.respectCase(). * back to case-sensitive */ ? -- H -- OpenPGP: https://hasan.d8u.us/openpgp.asc If you wish to request my

Re: [lang] Considering a new String utility class

2023-03-15 Thread Matt Benson
On Wed, Mar 15, 2023 at 9:47 PM Gary Gregory wrote: > On Wed, Mar 15, 2023 at 9:11 AM Matt Benson wrote: > > > > Agreed, Gary. Sounds promising. Maybe consider the "modern" terser > builder > > style a la AWS builders or such (i.e. since the "mutator" isn't a classic > > Java beans mutator in

Re: [lang] Considering a new String utility class

2023-03-15 Thread Hasan Diwan
+1 On Wed, 15 Mar 2023 at 05:58, Gary Gregory wrote: > PRs and issues like "[LANG-1682] Adding new startsWithAnyIgnoreCase > method and tests cases" keep popping up from time to time. > > My preference is to stop adding APIs that are variations of other APIs > based on case sensitivity (and

Re: [lang] Considering a new String utility class

2023-03-15 Thread Gary Gregory
On Wed, Mar 15, 2023 at 9:11 AM Matt Benson wrote: > > Agreed, Gary. Sounds promising. Maybe consider the "modern" terser builder > style a la AWS builders or such (i.e. since the "mutator" isn't a classic > Java beans mutator in any case, you can omit "set"). So a setter is called foo(value)

Re: [lang] Considering a new String utility class

2023-03-15 Thread Jochen Wiedmann
On Wed, Mar 15, 2023 at 1:58 PM Gary Gregory wrote: > Instead, I can see adding a new String utility class that tracks such > attributes on its instance such that you'd say something like: > - Strings.caseSensitive().someOperation(...) > - Strings.caseInsensitive().someOperation(...). Agreed

Re: [lang] Considering a new String utility class

2023-03-15 Thread Matt Benson
Agreed, Gary. Sounds promising. Maybe consider the "modern" terser builder style a la AWS builders or such (i.e. since the "mutator" isn't a classic Java beans mutator in any case, you can omit "set"). Matt On Wed, Mar 15, 2023, 8:06 AM Melloware wrote: > This sounds like a great idea! > > >

Re: [lang] Considering a new String utility class

2023-03-15 Thread Melloware
This sounds like a great idea! On 3/15/2023 8:58 AM, Gary Gregory wrote: PRs and issues like "[LANG-1682] Adding new startsWithAnyIgnoreCase method and tests cases" keep popping up from time to time. My preference is to stop adding APIs that are variations of other APIs based on case

[lang] Considering a new String utility class

2023-03-15 Thread Gary Gregory
PRs and issues like "[LANG-1682] Adding new startsWithAnyIgnoreCase method and tests cases" keep popping up from time to time. My preference is to stop adding APIs that are variations of other APIs based on case sensitivity (and Charset, Locale, and so on). Instead, I can see adding a new String