[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-19 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16053869#comment-16053869
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user asfgit closed the pull request at:

https://github.com/apache/commons-text/pull/46


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-18 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16053228#comment-16053228
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user chtompki commented on the issue:

https://github.com/apache/commons-text/pull/46
  
Will try to get to this today.


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16051393#comment-16051393
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user arunvinudss commented on the issue:

https://github.com/apache/commons-text/pull/46
  
@chtompki Updated with the changes you suggested .


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16046644#comment-16046644
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user arunvinudss commented on a diff in the pull request:

https://github.com/apache/commons-text/pull/46#discussion_r121417851
  
--- Diff: src/main/java/org/apache/commons/text/CaseUtils.java ---
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.text;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Case manipulation operations on Strings that contain words.
+ *
+ * This class tries to handle null input gracefully.
+ * An exception will not be thrown for a null input.
+ * Each method documents its behaviour in more detail.
+ *
+ * @since 1.0
+ */
+public class CaseUtils {
+
+/**
+ * CaseUtils instances should NOT be constructed in
+ * standard programming. Instead, the class should be used as
+ * CaseUtils.toCamelCase("foo bar", true, new 
char[]{'-'});.
+ * 
+ * This constructor is public to permit tools that require a 
JavaBean
+ * instance to operate.
+ */
+public CaseUtils() {
+super();
+}
+
+// Camel Case
+
//---
+/**
+ * Converts all the delimiter separated words in a String into 
camelCase,
+ * that is each word is made up of a titlecase character and then a 
series of
+ * lowercase characters. The  
+ *
+ * The delimiters represent a set of characters understood to 
separate words.
+ * The first non-delimiter character after a delimiter will be 
capitalized. The first String
+ * character may or may not be capitalized and it's determined by the 
user input for capitalizeFirstLetter
+ * variable.
+ *
+ * A null input String returns null.
+ * Capitalization uses the Unicode title case, normally equivalent to
+ * upper case.
+ *
+ * 
+ * CaseUtils.toCamelCase(null, false) 
= null
+ * CaseUtils.toCamelCase("", false, *)
= ""
+ * CaseUtils.toCamelCase(*, false, null)  
= *
+ * CaseUtils.toCamelCase(*, true, new char[0])
= *
+ * CaseUtils.toCamelCase("To.Camel.Case", false, new char[]{'.'}) 
= "toCamelCase"
+ * CaseUtils.toCamelCase(" to @ Camel case", true, new char[]{'@'})   
= "toCamelCase"
+ * CaseUtils.toCamelCase(" @to @ Camel case", false, new char[]{'@'}) 
= "toCamelCase"
+ * 
+ *
+ * @param str  the String to be converted to camelCase, may be null
+ * @param capitalizeFirstLetter boolean that determines if the first 
character of first word should be title case.
+ * @param delimiters  set of characters to determine capitalization, 
null and/or empty array means whitespace
+ * @return camelCase of String, null if null String input
+ */
+public static String toCamelCase(String str, boolean 
capitalizeFirstLetter, final char... delimiters) {
--- End diff --

I am a bit biased towards using String instead of CharSequence . Yes 
CharSequence allows us to pass String Buffers and builders and other types as 
input potentially increasing the scope of the function but considering the 
nature of work we do in this particular method it may not necessarily be a good 
idea. My basic contention is that the minute we call toString() on a 
charSequence  to do any sort of manipulation it becomes a costly operation and 
we may lose performance . 


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85

[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16046622#comment-16046622
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user arunvinudss commented on a diff in the pull request:

https://github.com/apache/commons-text/pull/46#discussion_r121408959
  
--- Diff: src/main/java/org/apache/commons/text/CaseUtils.java ---
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.text;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Case manipulation operations on Strings that contain words.
+ *
+ * This class tries to handle null input gracefully.
+ * An exception will not be thrown for a null input.
+ * Each method documents its behaviour in more detail.
+ *
+ * @since 1.0
+ */
+public class CaseUtils {
+
+/**
+ * CaseUtils instances should NOT be constructed in
+ * standard programming. Instead, the class should be used as
+ * CaseUtils.toCamelCase("foo bar", true, new 
char[]{'-'});.
+ * 
+ * This constructor is public to permit tools that require a 
JavaBean
+ * instance to operate.
+ */
+public CaseUtils() {
+super();
+}
+
+// Camel Case
+
//---
+/**
+ * Converts all the delimiter separated words in a String into 
camelCase,
+ * that is each word is made up of a titlecase character and then a 
series of
+ * lowercase characters. The  
+ *
+ * The delimiters represent a set of characters understood to 
separate words.
+ * The first non-delimiter character after a delimiter will be 
capitalized. The first String
+ * character may or may not be capitalized and it's determined by the 
user input for capitalizeFirstLetter
+ * variable.
+ *
+ * A null input String returns null.
+ * Capitalization uses the Unicode title case, normally equivalent to
+ * upper case.
+ *
+ * 
+ * CaseUtils.toCamelCase(null, false) 
= null
+ * CaseUtils.toCamelCase("", false, *)
= ""
+ * CaseUtils.toCamelCase(*, false, null)  
= *
+ * CaseUtils.toCamelCase(*, true, new char[0])
= *
+ * CaseUtils.toCamelCase("To.Camel.Case", false, new char[]{'.'}) 
= "toCamelCase"
+ * CaseUtils.toCamelCase(" to @ Camel case", true, new char[]{'@'})   
= "toCamelCase"
+ * CaseUtils.toCamelCase(" @to @ Camel case", false, new char[]{'@'}) 
= "toCamelCase"
+ * 
+ *
+ * @param str  the String to be converted to camelCase, may be null
+ * @param capitalizeFirstLetter boolean that determines if the first 
character of first word should be title case.
+ * @param delimiters  set of characters to determine capitalization, 
null and/or empty array means whitespace
+ * @return camelCase of String, null if null String input
+ */
+public static String toCamelCase(String str, boolean 
capitalizeFirstLetter, final char... delimiters) {
--- End diff --

Yes the boolean should be final not sure why I missed that . The input 
string is not final as you mentioned  I change it to lower case inside the 
method .


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> 

[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16046623#comment-16046623
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user chtompki commented on the issue:

https://github.com/apache/commons-text/pull/46
  
Regarding the `WordUtils.capitalizeFully`, let's open that discussion up in 
a new Jira. I'll do that now. I think those questions are quite valid.


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16046615#comment-16046615
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user arunvinudss commented on a diff in the pull request:

https://github.com/apache/commons-text/pull/46#discussion_r121406140
  
--- Diff: src/main/java/org/apache/commons/text/CaseUtils.java ---
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.text;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Case manipulation operations on Strings that contain words.
+ *
+ * This class tries to handle null input gracefully.
+ * An exception will not be thrown for a null input.
+ * Each method documents its behaviour in more detail.
+ *
+ * @since 1.0
+ */
+public class CaseUtils {
+
+/**
+ * CaseUtils instances should NOT be constructed in
+ * standard programming. Instead, the class should be used as
+ * CaseUtils.toCamelCase("foo bar", true, new 
char[]{'-'});.
+ * 
+ * This constructor is public to permit tools that require a 
JavaBean
+ * instance to operate.
+ */
+public CaseUtils() {
+super();
+}
+
+// Camel Case
+
//---
+/**
+ * Converts all the delimiter separated words in a String into 
camelCase,
+ * that is each word is made up of a titlecase character and then a 
series of
+ * lowercase characters. The  
+ *
+ * The delimiters represent a set of characters understood to 
separate words.
+ * The first non-delimiter character after a delimiter will be 
capitalized. The first String
+ * character may or may not be capitalized and it's determined by the 
user input for capitalizeFirstLetter
+ * variable.
+ *
+ * A null input String returns null.
+ * Capitalization uses the Unicode title case, normally equivalent to
+ * upper case.
+ *
+ * 
+ * CaseUtils.toCamelCase(null, false) 
= null
+ * CaseUtils.toCamelCase("", false, *)
= ""
+ * CaseUtils.toCamelCase(*, false, null)  
= *
+ * CaseUtils.toCamelCase(*, true, new char[0])
= *
+ * CaseUtils.toCamelCase("To.Camel.Case", false, new char[]{'.'}) 
= "toCamelCase"
+ * CaseUtils.toCamelCase(" to @ Camel case", true, new char[]{'@'})   
= "toCamelCase"
--- End diff --

Yes it's a documentation error I will update it . 


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16046514#comment-16046514
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user chtompki commented on a diff in the pull request:

https://github.com/apache/commons-text/pull/46#discussion_r121380270
  
--- Diff: src/main/java/org/apache/commons/text/CaseUtils.java ---
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.text;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Case manipulation operations on Strings that contain words.
+ *
+ * This class tries to handle null input gracefully.
+ * An exception will not be thrown for a null input.
+ * Each method documents its behaviour in more detail.
+ *
+ * @since 1.0
+ */
+public class CaseUtils {
+
+/**
+ * CaseUtils instances should NOT be constructed in
+ * standard programming. Instead, the class should be used as
+ * CaseUtils.toCamelCase("foo bar", true, new 
char[]{'-'});.
+ * 
+ * This constructor is public to permit tools that require a 
JavaBean
+ * instance to operate.
+ */
+public CaseUtils() {
+super();
+}
+
+// Camel Case
+
//---
+/**
+ * Converts all the delimiter separated words in a String into 
camelCase,
+ * that is each word is made up of a titlecase character and then a 
series of
+ * lowercase characters. The  
+ *
+ * The delimiters represent a set of characters understood to 
separate words.
+ * The first non-delimiter character after a delimiter will be 
capitalized. The first String
+ * character may or may not be capitalized and it's determined by the 
user input for capitalizeFirstLetter
+ * variable.
+ *
+ * A null input String returns null.
+ * Capitalization uses the Unicode title case, normally equivalent to
+ * upper case.
+ *
--- End diff --

I wonder if, like in 
[`Character.toUpperCase`](https://docs.oracle.com/javase/8/docs/api/java/lang/Character.html#toUpperCase-char-),
 we should document that we are not locale based which I support. Adding in 
`Locale` to the mix throws added complexity that may not be needed. Or document 
that we're relying on `Character.toTitleCase` which has no `Locale` based 
analogue in `String`.


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16046516#comment-16046516
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user chtompki commented on a diff in the pull request:

https://github.com/apache/commons-text/pull/46#discussion_r121380327
  
--- Diff: src/main/java/org/apache/commons/text/CaseUtils.java ---
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.text;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Case manipulation operations on Strings that contain words.
+ *
+ * This class tries to handle null input gracefully.
+ * An exception will not be thrown for a null input.
+ * Each method documents its behaviour in more detail.
+ *
+ * @since 1.0
+ */
+public class CaseUtils {
+
+/**
+ * CaseUtils instances should NOT be constructed in
+ * standard programming. Instead, the class should be used as
+ * CaseUtils.toCamelCase("foo bar", true, new 
char[]{'-'});.
+ * 
+ * This constructor is public to permit tools that require a 
JavaBean
+ * instance to operate.
+ */
+public CaseUtils() {
+super();
+}
+
+// Camel Case
+
//---
+/**
+ * Converts all the delimiter separated words in a String into 
camelCase,
+ * that is each word is made up of a titlecase character and then a 
series of
+ * lowercase characters. The  
+ *
+ * The delimiters represent a set of characters understood to 
separate words.
+ * The first non-delimiter character after a delimiter will be 
capitalized. The first String
+ * character may or may not be capitalized and it's determined by the 
user input for capitalizeFirstLetter
+ * variable.
+ *
+ * A null input String returns null.
+ * Capitalization uses the Unicode title case, normally equivalent to
+ * upper case.
+ *
+ * 
+ * CaseUtils.toCamelCase(null, false) 
= null
+ * CaseUtils.toCamelCase("", false, *)
= ""
+ * CaseUtils.toCamelCase(*, false, null)  
= *
+ * CaseUtils.toCamelCase(*, true, new char[0])
= *
+ * CaseUtils.toCamelCase("To.Camel.Case", false, new char[]{'.'}) 
= "toCamelCase"
+ * CaseUtils.toCamelCase(" to @ Camel case", true, new char[]{'@'})   
= "toCamelCase"
+ * CaseUtils.toCamelCase(" @to @ Camel case", false, new char[]{'@'}) 
= "toCamelCase"
+ * 
+ *
+ * @param str  the String to be converted to camelCase, may be null
+ * @param capitalizeFirstLetter boolean that determines if the first 
character of first word should be title case.
+ * @param delimiters  set of characters to determine capitalization, 
null and/or empty array means whitespace
+ * @return camelCase of String, null if null String input
+ */
+public static String toCamelCase(String str, boolean 
capitalizeFirstLetter, final char... delimiters) {
+if (StringUtils.isEmpty(str)) {
+return str;
+}
+str = str.toLowerCase();
+int strLen = str.length();
+int [] newCodePoints = new int[strLen];
+int outOffset = 0;
+Set delimiterSet = generateDelimiterSet(delimiters);
+boolean capitalizeNext = false;
+if (capitalizeFirstLetter) {
+capitalizeNext = true;
+}
+for (int index = 0; index < strLen;) {
+final int codePoint = str.codePointAt(index);
+
+if (delimiterSet.contains(codePoint)) {
+capitalizeNext = true;
+

[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16046513#comment-16046513
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user chtompki commented on a diff in the pull request:

https://github.com/apache/commons-text/pull/46#discussion_r121376021
  
--- Diff: src/main/java/org/apache/commons/text/CaseUtils.java ---
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.text;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Case manipulation operations on Strings that contain words.
+ *
+ * This class tries to handle null input gracefully.
+ * An exception will not be thrown for a null input.
+ * Each method documents its behaviour in more detail.
+ *
+ * @since 1.0
+ */
+public class CaseUtils {
+
+/**
+ * CaseUtils instances should NOT be constructed in
+ * standard programming. Instead, the class should be used as
+ * CaseUtils.toCamelCase("foo bar", true, new 
char[]{'-'});.
+ * 
+ * This constructor is public to permit tools that require a 
JavaBean
+ * instance to operate.
+ */
+public CaseUtils() {
+super();
+}
+
+// Camel Case
+
//---
+/**
+ * Converts all the delimiter separated words in a String into 
camelCase,
+ * that is each word is made up of a titlecase character and then a 
series of
+ * lowercase characters. The  
+ *
+ * The delimiters represent a set of characters understood to 
separate words.
+ * The first non-delimiter character after a delimiter will be 
capitalized. The first String
+ * character may or may not be capitalized and it's determined by the 
user input for capitalizeFirstLetter
+ * variable.
+ *
+ * A null input String returns null.
+ * Capitalization uses the Unicode title case, normally equivalent to
+ * upper case.
+ *
+ * 
+ * CaseUtils.toCamelCase(null, false) 
= null
+ * CaseUtils.toCamelCase("", false, *)
= ""
+ * CaseUtils.toCamelCase(*, false, null)  
= *
+ * CaseUtils.toCamelCase(*, true, new char[0])
= *
+ * CaseUtils.toCamelCase("To.Camel.Case", false, new char[]{'.'}) 
= "toCamelCase"
+ * CaseUtils.toCamelCase(" to @ Camel case", true, new char[]{'@'})   
= "toCamelCase"
--- End diff --

After looking at the tests, this appears to be merely a documentation error.


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16046520#comment-16046520
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user chtompki commented on a diff in the pull request:

https://github.com/apache/commons-text/pull/46#discussion_r121376797
  
--- Diff: src/main/java/org/apache/commons/text/CaseUtils.java ---
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.text;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Case manipulation operations on Strings that contain words.
+ *
+ * This class tries to handle null input gracefully.
+ * An exception will not be thrown for a null input.
+ * Each method documents its behaviour in more detail.
+ *
+ * @since 1.0
+ */
+public class CaseUtils {
+
+/**
+ * CaseUtils instances should NOT be constructed in
+ * standard programming. Instead, the class should be used as
+ * CaseUtils.toCamelCase("foo bar", true, new 
char[]{'-'});.
+ * 
+ * This constructor is public to permit tools that require a 
JavaBean
+ * instance to operate.
+ */
+public CaseUtils() {
+super();
+}
+
+// Camel Case
+
//---
+/**
+ * Converts all the delimiter separated words in a String into 
camelCase,
+ * that is each word is made up of a titlecase character and then a 
series of
+ * lowercase characters. The  
+ *
+ * The delimiters represent a set of characters understood to 
separate words.
+ * The first non-delimiter character after a delimiter will be 
capitalized. The first String
+ * character may or may not be capitalized and it's determined by the 
user input for capitalizeFirstLetter
+ * variable.
+ *
+ * A null input String returns null.
+ * Capitalization uses the Unicode title case, normally equivalent to
+ * upper case.
+ *
+ * 
+ * CaseUtils.toCamelCase(null, false) 
= null
+ * CaseUtils.toCamelCase("", false, *)
= ""
+ * CaseUtils.toCamelCase(*, false, null)  
= *
+ * CaseUtils.toCamelCase(*, true, new char[0])
= *
+ * CaseUtils.toCamelCase("To.Camel.Case", false, new char[]{'.'}) 
= "toCamelCase"
+ * CaseUtils.toCamelCase(" to @ Camel case", true, new char[]{'@'})   
= "toCamelCase"
+ * CaseUtils.toCamelCase(" @to @ Camel case", false, new char[]{'@'}) 
= "toCamelCase"
+ * 
+ *
+ * @param str  the String to be converted to camelCase, may be null
+ * @param capitalizeFirstLetter boolean that determines if the first 
character of first word should be title case.
+ * @param delimiters  set of characters to determine capitalization, 
null and/or empty array means whitespace
+ * @return camelCase of String, null if null String input
+ */
+public static String toCamelCase(String str, boolean 
capitalizeFirstLetter, final char... delimiters) {
--- End diff --

I think that we'll want:
```java
public static String toCamelCase(final String str, final boolean 
capitalizeFirstLetter, final char... delimiters)
```
but I see that you've fiddled with the `str` variable below. So I'm open to 
discussion on that point.

Generally, I'm torn on whether to have the signature be:
```java
public static String toCamelCase(final String str, final boolean 
capitalizeFirstLetter, final char... delimiters);
```
or
```java
public static String toCamelCase(final CharSequence str, final boolean 
capitalizeFirstLetter, final char... delimiters);
```


> Create CaseUtils class. Add toCamelCase

[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16046517#comment-16046517
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user chtompki commented on a diff in the pull request:

https://github.com/apache/commons-text/pull/46#discussion_r121374008
  
--- Diff: src/main/java/org/apache/commons/text/CaseUtils.java ---
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.text;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Case manipulation operations on Strings that contain words.
+ *
+ * This class tries to handle null input gracefully.
+ * An exception will not be thrown for a null input.
+ * Each method documents its behaviour in more detail.
+ *
+ * @since 1.0
+ */
+public class CaseUtils {
+
+/**
+ * CaseUtils instances should NOT be constructed in
+ * standard programming. Instead, the class should be used as
+ * CaseUtils.toCamelCase("foo bar", true, new 
char[]{'-'});.
+ * 
+ * This constructor is public to permit tools that require a 
JavaBean
+ * instance to operate.
+ */
+public CaseUtils() {
+super();
+}
+
+// Camel Case
+
//---
+/**
+ * Converts all the delimiter separated words in a String into 
camelCase,
+ * that is each word is made up of a titlecase character and then a 
series of
+ * lowercase characters. The  
+ *
+ * The delimiters represent a set of characters understood to 
separate words.
+ * The first non-delimiter character after a delimiter will be 
capitalized. The first String
+ * character may or may not be capitalized and it's determined by the 
user input for capitalizeFirstLetter
+ * variable.
+ *
+ * A null input String returns null.
+ * Capitalization uses the Unicode title case, normally equivalent to
+ * upper case.
+ *
+ * 
+ * CaseUtils.toCamelCase(null, false) 
= null
+ * CaseUtils.toCamelCase("", false, *)
= ""
+ * CaseUtils.toCamelCase(*, false, null)  
= *
+ * CaseUtils.toCamelCase(*, true, new char[0])
= *
+ * CaseUtils.toCamelCase("To.Camel.Case", false, new char[]{'.'}) 
= "toCamelCase"
+ * CaseUtils.toCamelCase(" to @ Camel case", true, new char[]{'@'})   
= "toCamelCase"
--- End diff --

Wouldn't we want
```java
CaseUtils.toCamelCase(" to @ Camel case", true, new char[]{'@'})   = 
"ToCamelCase"
```
because of the `true` boolean?


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16046518#comment-16046518
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user chtompki commented on a diff in the pull request:

https://github.com/apache/commons-text/pull/46#discussion_r121376091
  
--- Diff: src/main/java/org/apache/commons/text/CaseUtils.java ---
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.text;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Case manipulation operations on Strings that contain words.
+ *
+ * This class tries to handle null input gracefully.
+ * An exception will not be thrown for a null input.
+ * Each method documents its behaviour in more detail.
+ *
+ * @since 1.0
+ */
+public class CaseUtils {
+
+/**
+ * CaseUtils instances should NOT be constructed in
+ * standard programming. Instead, the class should be used as
+ * CaseUtils.toCamelCase("foo bar", true, new 
char[]{'-'});.
+ * 
+ * This constructor is public to permit tools that require a 
JavaBean
+ * instance to operate.
+ */
+public CaseUtils() {
+super();
+}
+
+// Camel Case
+
//---
+/**
+ * Converts all the delimiter separated words in a String into 
camelCase,
+ * that is each word is made up of a titlecase character and then a 
series of
+ * lowercase characters. The  
+ *
+ * The delimiters represent a set of characters understood to 
separate words.
+ * The first non-delimiter character after a delimiter will be 
capitalized. The first String
+ * character may or may not be capitalized and it's determined by the 
user input for capitalizeFirstLetter
+ * variable.
+ *
+ * A null input String returns null.
+ * Capitalization uses the Unicode title case, normally equivalent to
+ * upper case.
+ *
+ * 
+ * CaseUtils.toCamelCase(null, false) 
= null
+ * CaseUtils.toCamelCase("", false, *)
= ""
+ * CaseUtils.toCamelCase(*, false, null)  
= *
+ * CaseUtils.toCamelCase(*, true, new char[0])
= *
+ * CaseUtils.toCamelCase("To.Camel.Case", false, new char[]{'.'}) 
= "toCamelCase"
+ * CaseUtils.toCamelCase(" to @ Camel case", true, new char[]{'@'})   
= "toCamelCase"
+ * CaseUtils.toCamelCase(" @to @ Camel case", false, new char[]{'@'}) 
= "toCamelCase"
+ * 
+ *
+ * @param str  the String to be converted to camelCase, may be null
+ * @param capitalizeFirstLetter boolean that determines if the first 
character of first word should be title case.
+ * @param delimiters  set of characters to determine capitalization, 
null and/or empty array means whitespace
+ * @return camelCase of String, null if null String input
+ */
+public static String toCamelCase(String str, boolean 
capitalizeFirstLetter, final char... delimiters) {
+if (StringUtils.isEmpty(str)) {
+return str;
+}
+str = str.toLowerCase();
+int strLen = str.length();
+int [] newCodePoints = new int[strLen];
+int outOffset = 0;
+Set delimiterSet = generateDelimiterSet(delimiters);
+boolean capitalizeNext = false;
+if (capitalizeFirstLetter) {
+capitalizeNext = true;
+}
+for (int index = 0; index < strLen;) {
+final int codePoint = str.codePointAt(index);
+
+if (delimiterSet.contains(codePoint)) {
+capitalizeNext = true;
+

[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16046519#comment-16046519
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user chtompki commented on a diff in the pull request:

https://github.com/apache/commons-text/pull/46#discussion_r121378617
  
--- Diff: src/main/java/org/apache/commons/text/CaseUtils.java ---
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.text;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Case manipulation operations on Strings that contain words.
+ *
+ * This class tries to handle null input gracefully.
+ * An exception will not be thrown for a null input.
+ * Each method documents its behaviour in more detail.
+ *
+ * @since 1.0
+ */
+public class CaseUtils {
+
+/**
+ * CaseUtils instances should NOT be constructed in
+ * standard programming. Instead, the class should be used as
+ * CaseUtils.toCamelCase("foo bar", true, new 
char[]{'-'});.
+ * 
+ * This constructor is public to permit tools that require a 
JavaBean
+ * instance to operate.
+ */
+public CaseUtils() {
+super();
+}
+
+// Camel Case
+
//---
+/**
+ * Converts all the delimiter separated words in a String into 
camelCase,
+ * that is each word is made up of a titlecase character and then a 
series of
+ * lowercase characters. The  
+ *
+ * The delimiters represent a set of characters understood to 
separate words.
+ * The first non-delimiter character after a delimiter will be 
capitalized. The first String
+ * character may or may not be capitalized and it's determined by the 
user input for capitalizeFirstLetter
+ * variable.
+ *
+ * A null input String returns null.
+ * Capitalization uses the Unicode title case, normally equivalent to
+ * upper case.
+ *
+ * 
+ * CaseUtils.toCamelCase(null, false) 
= null
+ * CaseUtils.toCamelCase("", false, *)
= ""
+ * CaseUtils.toCamelCase(*, false, null)  
= *
+ * CaseUtils.toCamelCase(*, true, new char[0])
= *
+ * CaseUtils.toCamelCase("To.Camel.Case", false, new char[]{'.'}) 
= "toCamelCase"
+ * CaseUtils.toCamelCase(" to @ Camel case", true, new char[]{'@'})   
= "toCamelCase"
+ * CaseUtils.toCamelCase(" @to @ Camel case", false, new char[]{'@'}) 
= "toCamelCase"
+ * 
+ *
+ * @param str  the String to be converted to camelCase, may be null
+ * @param capitalizeFirstLetter boolean that determines if the first 
character of first word should be title case.
+ * @param delimiters  set of characters to determine capitalization, 
null and/or empty array means whitespace
+ * @return camelCase of String, null if null String input
+ */
+public static String toCamelCase(String str, boolean 
capitalizeFirstLetter, final char... delimiters) {
+if (StringUtils.isEmpty(str)) {
+return str;
+}
+str = str.toLowerCase();
+int strLen = str.length();
+int [] newCodePoints = new int[strLen];
+int outOffset = 0;
+Set delimiterSet = generateDelimiterSet(delimiters);
+boolean capitalizeNext = false;
+if (capitalizeFirstLetter) {
+capitalizeNext = true;
+}
+for (int index = 0; index < strLen;) {
+final int codePoint = str.codePointAt(index);
--- End diff --

If we decide to go with `CharSequence` here, this becomes a tougher move. 
We have to begin 

[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-12 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16046515#comment-16046515
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user chtompki commented on a diff in the pull request:

https://github.com/apache/commons-text/pull/46#discussion_r121374329
  
--- Diff: src/main/java/org/apache/commons/text/CaseUtils.java ---
@@ -0,0 +1,140 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.text;
+
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * Case manipulation operations on Strings that contain words.
+ *
+ * This class tries to handle null input gracefully.
+ * An exception will not be thrown for a null input.
+ * Each method documents its behaviour in more detail.
+ *
+ * @since 1.0
+ */
+public class CaseUtils {
+
+/**
+ * CaseUtils instances should NOT be constructed in
+ * standard programming. Instead, the class should be used as
+ * CaseUtils.toCamelCase("foo bar", true, new 
char[]{'-'});.
+ * 
+ * This constructor is public to permit tools that require a 
JavaBean
+ * instance to operate.
+ */
+public CaseUtils() {
--- End diff --

You could make the constructor `private`, but I do like the consistency 
with 
[`org.apache.commons.lang3.StringUtils.java`](https://github.com/apache/commons-lang/blob/master/src/main/java/org/apache/commons/lang3/StringUtils.java#L176-L186)


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16046112#comment-16046112
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user chtompki commented on the issue:

https://github.com/apache/commons-text/pull/46
  
Will look this over in the morning. 


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16045953#comment-16045953
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user sebbASF commented on the issue:

https://github.com/apache/commons-text/pull/46
  
I've just realised: this issue is about adding CaseUtils.toCamelCase.
Problems with WordUtils belong in a separate issue or JIRA


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16045950#comment-16045950
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user arunvinudss commented on the issue:

https://github.com/apache/commons-text/pull/46
  
@sebbASF  Nope the first letter is not capitalized and I expected the same 
. It seems to happen if the specified delimiters are not available on the input 
though .


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16045945#comment-16045945
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user sebbASF commented on the issue:

https://github.com/apache/commons-text/pull/46
  
An empty delimiter array means the caller does not want any delimiters to 
be used.
But I would expect the output to capitalise the first letter:

WordUtils.capitalizeFully("i am fine", new char[]{}) --> I am fine

Likewise if the specified delimiters are not found in the input the first 
letter should be capitalised.
Does it not do so?


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16045935#comment-16045935
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user arunvinudss commented on the issue:

https://github.com/apache/commons-text/pull/46
  
@chtompki Just wondering why space is added as a default delimiter for null 
delimiter arrays but not for empty delimiter array in WordUtils.capitalizeFully 
.

WordUtils.capitalizeFully("i am fine") --> I Am Fine
WordUtils.capitalizeFully("i am fine", null) --> I Am Fine
WordUtils.capitalizeFully("i am fine", new char[]{}) --> i am fine

I do understand why it happens but not sure if it was intentional ? 


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16045928#comment-16045928
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user arunvinudss commented on the issue:

https://github.com/apache/commons-text/pull/46
  
@chtompki The current implementation is based on these assumptions.

- All delimiters are stripped off .
- Space(32) is added as the default delimiter for all scenarios including 
null and empty delimiter array.
- The boolean parameter for capitalizeFirstCharacter gets higher precedence 
than delimiters. For ex if '-' is the delimiter then -abc will give Abc  as 
output if true is set for capitalizeFirstCharacter. 
- A string with no alphabets and only delimiters will return back the input 
with no changes. 

Just made logical conclusions let me know if need any changes .



> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16045922#comment-16045922
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user arunvinudss commented on the issue:

https://github.com/apache/commons-text/pull/46
  
@chtompki Using HashSets for checking delimiters it reduces the time 
complexity from O(nk) to O(n) . I feel it's more efficient . 


> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16045916#comment-16045916
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user coveralls commented on the issue:

https://github.com/apache/commons-text/pull/46
  

[![Coverage 
Status](https://coveralls.io/builds/11920859/badge)](https://coveralls.io/builds/11920859)

Coverage increased (+0.04%) to 96.691% when pulling 
**2de01ba6a343ffcce673768e1c603e27dfbda3e9 on arunvinudss:TEXT-85** into 
**5f498c0f4783d035bfeb77517731c948f8567b1e on apache:master**.



> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16045917#comment-16045917
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user coveralls commented on the issue:

https://github.com/apache/commons-text/pull/46
  

[![Coverage 
Status](https://coveralls.io/builds/11920859/badge)](https://coveralls.io/builds/11920859)

Coverage increased (+0.04%) to 96.691% when pulling 
**2de01ba6a343ffcce673768e1c603e27dfbda3e9 on arunvinudss:TEXT-85** into 
**5f498c0f4783d035bfeb77517731c948f8567b1e on apache:master**.



> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16045918#comment-16045918
 ] 

ASF GitHub Bot commented on TEXT-85:


Github user coveralls commented on the issue:

https://github.com/apache/commons-text/pull/46
  

[![Coverage 
Status](https://coveralls.io/builds/11920859/badge)](https://coveralls.io/builds/11920859)

Coverage increased (+0.04%) to 96.691% when pulling 
**2de01ba6a343ffcce673768e1c603e27dfbda3e9 on arunvinudss:TEXT-85** into 
**5f498c0f4783d035bfeb77517731c948f8567b1e on apache:master**.



> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-11 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16045911#comment-16045911
 ] 

ASF GitHub Bot commented on TEXT-85:


GitHub user arunvinudss opened a pull request:

https://github.com/apache/commons-text/pull/46

TEXT-85:Added CaseUtils class with camel case conversion support



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/arunvinudss/commons-text TEXT-85

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/commons-text/pull/46.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #46


commit 5b8c5ea3b7e39a49a9ee66588a2d8fbc5d8cc6e7
Author: Arun Vinud 
Date:   2017-06-11T11:36:21Z

TEXT-85:Added CaseUtils class with camel case conversion




> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-09 Thread Rob Tompkins (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16044576#comment-16044576
 ] 

Rob Tompkins commented on TEXT-85:
--

Arun I assigned the issue to me, but will keep an eye out for a PR. I'll work 
on pulling it in when you have a proposed solution.

> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>Assignee: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


[jira] [Commented] (TEXT-85) Create CaseUtils class. Add toCamelCase

2017-06-07 Thread Arun Vinud (JIRA)

[ 
https://issues.apache.org/jira/browse/TEXT-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16040890#comment-16040890
 ] 

Arun Vinud  commented on TEXT-85:
-

Sounds like a great idea and indeed it would be a very useful addition . I can 
work on this and looks like an ideal start for my contribution to this amazing 
community .

> Create CaseUtils class. Add toCamelCase
> ---
>
> Key: TEXT-85
> URL: https://issues.apache.org/jira/browse/TEXT-85
> Project: Commons Text
>  Issue Type: Improvement
>Reporter: Rob Tompkins
>
> Based on the conversation here:
> http://markmail.org/message/7nvizsbykvxpr7g5
> We wish to have a {{toCamelCase}} method. The suggestion is to create a 
> {{CaseUtils}} class.
> I wonder if we should think about deprecating the case management in 
> {{WordUtils}} and move it over? Maybe, maybe not.
> I would think our method signature would look something like:
> {code}
> String toCamelCase(String str, char delimiter, boolean capitalizeFirstLetter)
> {code}
> potentially with {{String}} replaced with {{CharSequence}}.
> Lastly, {{WordUtils.capitalizeFully(String str, final char... delimiters)}} 
> might be a good starting point. 
> https://github.com/apache/commons-text/blob/master/src/main/java/org/apache/commons/text/WordUtils.java#L467-L499



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)