Class StringUtil
java.lang.Object
de.muehlencord.shared.util.StringUtil
- Author:
- Joern Muehlencord (joern@muehlencord.de)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetBlankedString(int length, String s) fills s with blanks if s < lengthstatic <T> StringgetCommaListString(Class<T> clazz, T[] typeArray, String methodName) getEnumString(Class<E> clazz, E[] enumValues, String method) static StringgetISOString(String input) returns the given string in ISO-8859-1 encodingstatic Stringreturns the stackstrace as one stringstatic StringgetValueBetweenKeywords(String content, String keyWord1, String keyWord2) returns the string located between the two given keywordsstatic booleanreturns true, if given string is either null or a blank string
-
Constructor Details
-
StringUtil
public StringUtil()
-
-
Method Details
-
getISOString
returns the given string in ISO-8859-1 encoding- Parameters:
input- the input string in UTF-8- Returns:
- the converted string in
- Throws:
StringEncodingException- if the string cannot be converted
-
getStackTraceString
-
getBlankedString
-
getValueBetweenKeywords
public static String getValueBetweenKeywords(String content, String keyWord1, String keyWord2) throws ParseException returns the string located between the two given keywords- Parameters:
content- the string to get the value fromkeyWord1- the starting keywordkeyWord2- the end keyword- Returns:
- the string between keyword1 and keyword2
- Throws:
ParseException- if the value cannot be determined - e.g. if one of the keywords is not found
-
isEmpty
returns true, if given string is either null or a blank string- Parameters:
s- the string to check- Returns:
- true, if s is either null or s.equals("")
-
getEnumString
-
getCommaListString
public static <T> String getCommaListString(Class<T> clazz, T[] typeArray, String methodName) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
-