net.fckeditor.tool
Class Utils

java.lang.Object
  extended by net.fckeditor.tool.Utils

public class Utils
extends Object

Static helper methods for strings.

Version:
$Id: Utils.java 3832 2009-07-08 17:44:17Z mosipov $

Field Summary
static String EMPTY_STRING
          The empty string "".
 
Constructor Summary
Utils()
           
 
Method Summary
static Set<String> getSet(String stringList)
          Constructs a set of lower-cased strings from a | (pipe) delimited string.
static Set<String> getSet(String stringList, String delimiter)
          Constructs a set of lower-cased strings from a delimiter-separated string.
static boolean isBlank(String str)
          Checks if a string is whitespace, empty ("") or null.
static boolean isEmpty(String str)
          Checks if a string is empty ("") or null.
static boolean isNotBlank(String str)
          Checks if a string is not empty (""), not null and not whitespace.
static boolean isNotEmpty(String str)
          Checks if a string is not empty ("") and not null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_STRING

public static final String EMPTY_STRING
The empty string "".

See Also:
Constant Field Values
Constructor Detail

Utils

public Utils()
Method Detail

getSet

public static Set<String> getSet(String stringList,
                                 String delimiter)
Constructs a set of lower-cased strings from a delimiter-separated string.

Parameters:
stringList - strings separated with a delimiter
delimiter - separating delimiter
Returns:
a lower-cased set, empty set if stringList is empty
Throws:
IllegalArgumentException - if delimiter is empty

getSet

public static Set<String> getSet(String stringList)
Constructs a set of lower-cased strings from a | (pipe) delimited string.

Parameters:
stringList - strings separated with a delimiter
Returns:
a lower-cased set, empty set if stringList is empty
Throws:
IllegalArgumentException - if delimiter is empty
See Also:
getSet(String, String)

isEmpty

public static boolean isEmpty(String str)
Checks if a string is empty ("") or null.

Parameters:
str - string to check, may be null
Returns:
true if the string is null or empty, else false

isNotEmpty

public static boolean isNotEmpty(String str)
Checks if a string is not empty ("") and not null.

Parameters:
str - string to check, may be null
Returns:
true if the string is not empty and not null, else false

isBlank

public static boolean isBlank(String str)
Checks if a string is whitespace, empty ("") or null. Whitespace is checked by Character.isWhitespace(char).

Parameters:
str - string to check, may be null
Returns:
true if the string is null, empty or whitespace

isNotBlank

public static boolean isNotBlank(String str)
Checks if a string is not empty (""), not null and not whitespace.

Parameters:
str - string to check, may be null
Returns:
true if the string is not null, not empty and not whitespace.


Copyright © 2004-2009 Frederico Caldeira Knabben. All Rights Reserved.