Re: [text] Upper/Lower case enum

2018-02-23 Thread Gary Gregory
On Fri, Feb 23, 2018 at 12:53 PM, ajs6f wrote: > Perhaps ? > Try it, I do not think it is so nice, mostly because just like with char[] that means converting everything to a String to get to String#toUpper/LowerCase. Unless we reimplement the algorithm ourselves. Gary > ajs6f > > > On Feb 23,

Re: [text] Upper/Lower case enum

2018-02-23 Thread ajs6f
Perhaps ? ajs6f > On Feb 23, 2018, at 12:12 PM, Gary Gregory wrote: > > On Fri, Feb 23, 2018 at 10:05 AM, Gary Gregory > wrote: > >> >> >> On Fri, Feb 23, 2018 at 10:04 AM, Gary Gregory >> wrote: >> >>> >>> >>> On Fri, Feb 23, 2018 at 7:03 AM, Matt Benson wrote: >>> On Feb 23, 20

Re: [text] Upper/Lower case enum

2018-02-23 Thread Gary Gregory
On Fri, Feb 23, 2018 at 10:05 AM, Gary Gregory wrote: > > > On Fri, Feb 23, 2018 at 10:04 AM, Gary Gregory > wrote: > >> >> >> On Fri, Feb 23, 2018 at 7:03 AM, Matt Benson wrote: >> >>> On Feb 23, 2018 4:26 AM, "sebb" wrote: >>> >>> On 23 February 2018 at 00:41, Gary Gregory >>> wrote: >>> >

Re: [text] Upper/Lower case enum

2018-02-23 Thread Gary Gregory
On Fri, Feb 23, 2018 at 10:04 AM, Gary Gregory wrote: > > > On Fri, Feb 23, 2018 at 7:03 AM, Matt Benson wrote: > >> On Feb 23, 2018 4:26 AM, "sebb" wrote: >> >> On 23 February 2018 at 00:41, Gary Gregory >> wrote: >> > On Thu, Feb 22, 2018 at 4:27 PM, sebb wrote: >> > >> >> On 22 February 20

Re: [text] Upper/Lower case enum

2018-02-23 Thread Gary Gregory
On Fri, Feb 23, 2018 at 7:03 AM, Matt Benson wrote: > On Feb 23, 2018 4:26 AM, "sebb" wrote: > > On 23 February 2018 at 00:41, Gary Gregory wrote: > > On Thu, Feb 22, 2018 at 4:27 PM, sebb wrote: > > > >> On 22 February 2018 at 23:15, Gary Gregory > wrote: > >> > On Thu, Feb 22, 2018 at 4:11

Re: [text] Upper/Lower case enum

2018-02-23 Thread Matt Benson
On Feb 23, 2018 4:26 AM, "sebb" wrote: On 23 February 2018 at 00:41, Gary Gregory wrote: > On Thu, Feb 22, 2018 at 4:27 PM, sebb wrote: > >> On 22 February 2018 at 23:15, Gary Gregory wrote: >> > On Thu, Feb 22, 2018 at 4:11 PM, sebb wrote: >> > >> >> On 22 February 2018 at 22:27, Gary Gregor

Re: [text] Upper/Lower case enum

2018-02-23 Thread sebb
On 23 February 2018 at 00:41, Gary Gregory wrote: > On Thu, Feb 22, 2018 at 4:27 PM, sebb wrote: > >> On 22 February 2018 at 23:15, Gary Gregory wrote: >> > On Thu, Feb 22, 2018 at 4:11 PM, sebb wrote: >> > >> >> On 22 February 2018 at 22:27, Gary Gregory >> wrote: >> >> > Use your imagination

Re: [text] Upper/Lower case enum

2018-02-22 Thread Jochen Wiedmann
On Thu, Feb 22, 2018 at 11:14 PM, Otto Fowler wrote: > What problem does it solve? Good for functional programming? - To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.a

Re: [text] Upper/Lower case enum

2018-02-22 Thread Peter Burka
This feels like it might have been more useful pre-Java 8. Why not use a lamda function, which would permit arbitrary string transformations? /peter On Thu, Feb 22, 2018, 7:42 PM Gary Gregory wrote: > On Thu, Feb 22, 2018 at 4:27 PM, sebb wrote: > > > On 22 February 2018 at 23:15, Gary Gregory

Re: [text] Upper/Lower case enum

2018-02-22 Thread Gary Gregory
On Thu, Feb 22, 2018 at 4:27 PM, sebb wrote: > On 22 February 2018 at 23:15, Gary Gregory wrote: > > On Thu, Feb 22, 2018 at 4:11 PM, sebb wrote: > > > >> On 22 February 2018 at 22:27, Gary Gregory > wrote: > >> > Use your imagination ;-) > >> > >> What would the new code look like? > > I mean

Re: [text] Upper/Lower case enum

2018-02-22 Thread sebb
On 22 February 2018 at 23:15, Gary Gregory wrote: > On Thu, Feb 22, 2018 at 4:11 PM, sebb wrote: > >> On 22 February 2018 at 22:27, Gary Gregory wrote: >> > Use your imagination ;-) >> >> What would the new code look like? I mean the user code before and after the enum is introduced. >> > > I

Re: [text] Upper/Lower case enum

2018-02-22 Thread Gary Gregory
On Thu, Feb 22, 2018 at 4:11 PM, sebb wrote: > On 22 February 2018 at 22:27, Gary Gregory wrote: > > Use your imagination ;-) > > What would the new code look like? > I posted the code at the start of this thread... Gary > > How does it compare with code that does not have the enum? > > > I

Re: [text] Upper/Lower case enum

2018-02-22 Thread sebb
On 22 February 2018 at 22:27, Gary Gregory wrote: > Use your imagination ;-) What would the new code look like? How does it compare with code that does not have the enum? > I use it in the following contexts: > - To pass to a hex dump method to configure where the alpha chars should be > in low

Re: [text] Upper/Lower case enum

2018-02-22 Thread Gary Gregory
Use your imagination ;-) I use it in the following contexts: - To pass to a hex dump method to configure where the alpha chars should be in lower case or upper case. - To configure a parameterized JUnit test class to configure the case of HTTP headers and values. - To normalize input Gary On Th

Re: [text] Upper/Lower case enum

2018-02-22 Thread Otto Fowler
What problem does it solve? On February 22, 2018 at 17:02:34, Gary Gregory (garydgreg...@gmail.com) wrote: Does anyone think this is useful and general enough to add to Commons Text: /** * Enumerates letter cases and converts strings. * * @author mailto:ggreg...@rocketsoftware.com";>Gary Gregory

[text] Upper/Lower case enum

2018-02-22 Thread Gary Gregory
Does anyone think this is useful and general enough to add to Commons Text: /** * Enumerates letter cases and converts strings. * * @author mailto:ggreg...@rocketsoftware.com";>Gary Gregory */ public enum LetterCase { LOWER { @Override public String toCaseString(final Strin