com.zmicer.utils
Class StringUtils

java.lang.Object
  extended by com.zmicer.utils.StringUtils

public class StringUtils
extends Object

This class contains utilities working with String object (advanced splitting functionality etc). $Author:: zmicer $
$Rev:: 57 $
* $Date:: 2007-08-23 09:16:37 #$


Field Summary
static org.apache.log4j.Logger LOG
          Logger instance.
 
Constructor Summary
StringUtils()
           
 
Method Summary
static Boolean getBoolean(String string)
          Safely convert the String to Boolean
static Integer getInteger(String string)
          Return the Integer using the provided String.
static String joinStringsWithLineFolding(List<String> strings)
          Split the provided string using the line folding as separator.
static List<String> split(String str, String splitter)
          Make the splitting of the String into the List of String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

public static final org.apache.log4j.Logger LOG
Logger instance.

Constructor Detail

StringUtils

public StringUtils()
Method Detail

split

public static List<String> split(String str,
                                 String splitter)
Make the splitting of the String into the List of String. The StringTokenizer is used for splitting the String.

Parameters:
splitter - The String splitter, Can not be null (otherwise IllegalArgumentException would appear).
str - String to be splitted, Can not be null (otherwise IllegalArgumentException would appear).
Returns:
the List of Objects were taken from the str source string

getBoolean

public static Boolean getBoolean(String string)
Safely convert the String to Boolean

Parameters:
string - String to be converted, Can not be null/empty (otherwise IllegalArgumentException would appear).
Returns:
the Boolean value, the null in the case the String doesn't contain the boolean value.

getInteger

public static Integer getInteger(String string)
Return the Integer using the provided String. This method is used for the safe working with the integers are represented by the String objects

Parameters:
string - String to be processed. Can not be null or empty (otherwise IllegalArgumentException would appear).
Returns:
filled Integer or the null in the case the string stores incorrect value

joinStringsWithLineFolding

public static String joinStringsWithLineFolding(List<String> strings)
Split the provided string using the line folding as separator.

Parameters:
strings - the List of String to be splitted. Can not be null (otherwise IllegalArgumentException would appear).
Returns:
the result string


Copyright © 2007 jzmicer.team. All Rights Reserved.