|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rhq.core.clientapi.util.StringUtil
public class StringUtil
| Constructor Summary | |
|---|---|
StringUtil()
|
|
| Method Summary | |
|---|---|
static String |
arrayToString(boolean[] array)
Print out an array as a String |
static String |
arrayToString(int[] array)
Print out an array as a String |
static String |
arrayToString(Object[] array)
Print out an array as a String |
static String |
arrayToString(Object[] array,
char delim)
Print out an array as a String |
static String |
capitalize(String str)
Capitalizes the first letter of str. |
static String |
collectionToString(Collection collection)
|
static String |
collectionToString(Collection collection,
String delim)
|
static List<String> |
explode(String s,
String delim)
Split a string on delimiter boundaries, and place each element into a List. |
static String[] |
explodeQuoted(String arg)
Split a string up by whitespace, taking into account quoted subcomponents. |
static String[] |
explodeToArray(String toExplode,
String delim)
Split a string on delimiter boundaries, and place each element into an Array. |
static String |
formatDuration(long duration)
|
static String |
formatDuration(long duration,
int scale,
boolean minDigits)
|
static String |
getFirstStackTrace(Throwable t)
|
static String |
getStackTrace(Throwable t)
|
static String |
implode(List objs,
String delim)
Create a string formulated by inserting a delimiter in between consecutive array elements. |
static String |
iteratorToString(Iterator i,
String delim)
Print out everything in an Iterator in a user-friendly string format. |
static String |
iteratorToString(Iterator i,
String delim,
String quoteChar)
Print out everything in an Iterator in a user-friendly string format. |
static String |
listToString(List list)
Print out a List in a user-friendly string format. |
static String |
listToString(List list,
String delim)
Print out a List in a user-friendly string format. |
static String |
normalizePath(String s)
|
static String |
pluralize(String word)
|
static String |
remove(String source,
String find)
|
static String |
removePrefix(String value,
String prefix)
Remove a prefix from a string. |
static String |
repeatChars(char c,
int nTimes)
|
static String |
replace(String source,
String find,
String replace)
|
static String |
truncate(String s,
int truncLength,
boolean removeWhiteSpace)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringUtil()
| Method Detail |
|---|
public static String replace(String source,
String find,
String replace)
source - The source string to perform replacements on.find - The substring to find in source.replace - The string to replace 'find' within source
public static String remove(String source,
String find)
source - The source string to perform replacements on.find - The substring to find in source.
public static String iteratorToString(Iterator i,
String delim)
i - An iterator to print out.delim - The delimiter to use between elements.
public static String iteratorToString(Iterator i,
String delim,
String quoteChar)
i - An iterator to print out.delim - The delimiter to use between elements.quoteChar - The character to quote each element with.
public static String listToString(List list,
String delim)
list - A List to print out.delim - The delimiter to use between elements.
public static String collectionToString(Collection collection,
String delim)
public static String listToString(List list)
list - A List to print out.
public static String collectionToString(Collection collection)
public static String arrayToString(Object[] array)
public static String arrayToString(boolean[] array)
public static String arrayToString(Object[] array,
char delim)
array - The array to print outdelim - The delimiter to use between elements.public static String arrayToString(int[] array)
public static String implode(List objs,
String delim)
objs - List of objects to implode (elements may not be null)delim - String to place inbetween elements
public static List<String> explode(String s,
String delim)
s - String to split updelim - Delimiting token, ala StringTokenizer
public static String[] explodeToArray(String toExplode,
String delim)
toExplode - String to split updelim - Delimiting token, ala StringTokenizer
public static String[] explodeQuoted(String arg)
throws IllegalArgumentException
arg - String to parse
IllegalArgumentException - indicating there was a quoting error
public static String removePrefix(String value,
String prefix)
public static String pluralize(String word)
public static String getStackTrace(Throwable t)
public static String getFirstStackTrace(Throwable t)
public static String normalizePath(String s)
s - A string that might contain unix-style path separators.
public static String formatDuration(long duration)
public static String formatDuration(long duration,
int scale,
boolean minDigits)
public static String repeatChars(char c,
int nTimes)
public static String capitalize(String str)
str - The string to capitalize.
str capitalized. Returns null if str is null.
public static String truncate(String s,
int truncLength,
boolean removeWhiteSpace)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||