package de.jformchecker;

/**
 * Some basic string utils to avoid dependance to commons
 * @author jochen
 *
 */
public class StringUtils {
	
	public static final String EMPTY_STR = "";
	
    public static boolean isEmpty(final CharSequence cs) {
        return cs == null || cs.length() == 0;
    }
    public static String defaultString(final String str) {
        return str == null ? EMPTY_STR : str;
    }

    
}

@@ -81,16 +81,20 @@
 commons%0A
+ * %0A
  * @auth
@@ -141,11 +141,11 @@
 s %7B%0A
-%09%0A%09
+%0A  
 publ
@@ -187,14 +187,11 @@
 %22%22;%0A
-%09%0A 
+%0A
   
- 
 publ
@@ -237,28 +237,24 @@
 uence cs) %7B%0A
-    
     return c
@@ -290,14 +290,11 @@
 ;%0A  
- 
- 
 %7D%0A
-  
+%0A
   pu
@@ -346,20 +346,16 @@
  str) %7B%0A
-    
     retu
@@ -361,49 +361,374 @@
 urn 
-str == null ? EMPTY_STR : str;%0A    %7D%0A%0A    
+alternative(str, EMPTY_STR);%0A  %7D%0A%0A  /**%0A   * checks if the original string is empty. if empty/null return the alternative, otherwise the%0A   * original%0A   * %0A   * @param original%0A   * @param alternative%0A   * @return%0A   */%0A  public static String alternative(final String original, final String alternative) %7B%0A    return isEmpty(original) ? alternative : original;%0A  %7D%0A%0A
 %0A%7D%0A

Add another utility method