commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pascalschumac...@apache.org
Subject [3/3] [text] TEXT-85: Added CaseUtils class with camel case conversion
Date Thu, 22 Jun 2017 18:25:25 GMT
TEXT-85: Added CaseUtils class with camel case conversion

correct since javadoc tag and other minimal clean-ups


Project: http://git-wip-us.apache.org/repos/asf/commons-text/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-text/commit/25ec8d18
Tree: http://git-wip-us.apache.org/repos/asf/commons-text/tree/25ec8d18
Diff: http://git-wip-us.apache.org/repos/asf/commons-text/diff/25ec8d18

Branch: refs/heads/master
Commit: 25ec8d186b37b8d0a85a9c42d10a107966ce955d
Parents: 997a613
Author: Pascal Schumacher <pascalschumacher@gmx.net>
Authored: Thu Jun 22 20:25:13 2017 +0200
Committer: Pascal Schumacher <pascalschumacher@gmx.net>
Committed: Thu Jun 22 20:25:13 2017 +0200

----------------------------------------------------------------------
 src/main/java/org/apache/commons/text/CaseUtils.java | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-text/blob/25ec8d18/src/main/java/org/apache/commons/text/CaseUtils.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/text/CaseUtils.java b/src/main/java/org/apache/commons/text/CaseUtils.java
index 0e313a4..ae2067e 100644
--- a/src/main/java/org/apache/commons/text/CaseUtils.java
+++ b/src/main/java/org/apache/commons/text/CaseUtils.java
@@ -28,7 +28,7 @@ import java.util.Set;
  * An exception will not be thrown for a <code>null</code> input.
  * Each method documents its behaviour in more detail.</p>
  *
- * @since 1.0
+ * @since 1.2
  */
 public class CaseUtils {
 
@@ -44,8 +44,6 @@ public class CaseUtils {
         super();
     }
 
-    // Camel Case
-    //-----------------------------------------------------------------------
     /**
      * <p>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
@@ -112,19 +110,17 @@ public class CaseUtils {
         } else {
             return str;
         }
-
     }
 
     /**
      * <p>Converts an array of delimiters to a hash set of code points. Code point
of space(32) is added
-     * as the default value. The generated hash set provides O(1)
-     * lookup time .</p>
+     * as the default value. The generated hash set provides O(1) lookup time.</p>
      *
      * @param delimiters  set of characters to determine capitalization, null means whitespace
      * @return Set<Integer>
      */
     private static Set<Integer> generateDelimiterSet(final char[] delimiters) {
-        Set<Integer> delimiterHashSet = new HashSet<Integer>();
+        Set<Integer> delimiterHashSet = new HashSet<>();
         delimiterHashSet.add(Character.codePointAt(new char[]{' '}, 0));
         if (delimiters == null || delimiters.length == 0) {
             return delimiterHashSet;
@@ -134,7 +130,6 @@ public class CaseUtils {
             delimiterHashSet.add(Character.codePointAt(delimiters, index));
         }
         return delimiterHashSet;
-
     }
 }
 


Mime
View raw message