package net.sf.kerner.utils;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class StringUtils {

	private StringUtils() {
	}

	public final static String NEW_LINE_STRING = System.getProperty("line.separator");

	public static String getRandomString() {
		final String result = Long.toHexString(Double.doubleToLongBits(Math.random()));
		return result;
	}

	/**
	 * 
	 * Check if a string is null, empty or contains only whitespaces.
	 * 
	 * @param string
	 *            String to check
	 * @return true, if this string is null, empty or contains only whitespaces;
	 *         false otherwise
	 */
	public static boolean emptyString(String string) {
		if (string == null)
			return true;
		if (string.length() < 1)
			return true;
		if (string.matches("\\s"))
			return true;
		return false;
	}

	public static List<String> getStringList(Collection<?> list) {
		final List<String> result = new ArrayList<String>();
		for (Object o : list) {
			result.add(o.toString());
		}
		return result;
	}
}

@@ -1,114 +1,1127 @@
-package net.sf.kerner.utils;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.List;%0A
+/**********************************************************************%0ACopyright (c) 2009-2012 Alexander Kerner. All rights reserved.%0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at%0A%0A    http://www.apache.org/licenses/LICENSE-2.0%0A%0AUnless required by applicable law or agreed to in writing, software%0Adistributed under the License is distributed on an %22AS IS%22 BASIS,%0AWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0ASee the License for the specific language governing permissions and%0Alimitations under the License.%0A ***********************************************************************/%0A%0Apackage net.sf.kerner.utils;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.Collection;%0Aimport java.util.List;%0A%0A/**%0A * %0A * Utility class for %7B@link String%7D related stuff.%0A * %0A * %3Cp%3E%0A * %3Cb%3EExample:%3C/b%3E%3Cbr%3E%0A * %0A * %3C/p%3E%0A * %3Cp%3E%0A * %0A * %3Cpre%3E%0A * TODO example%0A * %3C/pre%3E%0A * %0A * %3C/p%3E%0A * %0A * @author %3Ca href=%22mailto:alex.kerner.24@googlemail.com%22%3EAlexander Kerner%3C/a%3E%0A * @version Apr 13, 2012%0A * %0A */
 %0Apub
@@ -1170,24 +1170,72 @@
 ils() %7B%0A%09%7D%0A%0A
+%09/**%0A%09 * System dependent new line string.%0A%09 */%0A
 %09public fina
@@ -1307,16 +1307,77 @@
 tor%22);%0A%0A
+%09/**%0A%09 * %0A%09 * %0A%09 * %0A%09 * @return a random %7B@code String%7D%0A%09 */%0A
 %09public 
@@ -1540,36 +1540,44 @@
  if a string is 
+%7B@code 
 null
+%7D
 , empty or conta
@@ -1636,22 +1636,30 @@
         
+%7B@code 
 String
+%7D
  to chec
@@ -1690,22 +1690,38 @@
 his 
-s
+%7B@code S
 tring
+%7D
  is 
+%7B@code 
 null
+%7D
 , em
@@ -1727,32 +1727,44 @@
 mpty or contains
+%0A%09 *        
  only whitespace
@@ -1765,28 +1765,16 @@
 espaces;
-%0A%09 *        
  false o
@@ -1987,206 +1987,7 @@
 ;%0A%09%7D
-%0A%0A%09public static List%3CString%3E getStringList(Collection%3C?%3E list) %7B%0A%09%09final List%3CString%3E result = new ArrayList%3CString%3E();%0A%09%09for (Object o : list) %7B%0A%09%09%09result.add(o.toString());%0A%09%09%7D%0A%09%09return result;%0A%09%7D
 %0A%7D%0A

Remove StringUtils#toStringList(). Use ListUtils instead.