|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.perf4j.helpers.MiscUtils
public class MiscUtils
Miscellaneous static utility functions, mainly having to do with String parsing/formatting.
| Field Summary | |
|---|---|
static String |
NEWLINE
The value of the line.separator system property. |
| Constructor Summary | |
|---|---|
MiscUtils()
|
|
| Method Summary | |
|---|---|
static StringBuilder |
escapeStringForCsv(String string,
StringBuilder toAppend)
Escapes the specified string for use in a comma-separated values file. |
static String |
formatDateIso8601(long timeInMillis)
Formats the specified time in yyyy-MM-dd HH:mm:ss format. |
static StringBuilder |
padIntToTwoDigits(int i,
StringBuilder toAppend)
Pads the specified int to two digits, prefixing with 0 if the value is less than 10. |
static String[] |
splitAndTrim(String stringToSplit,
String delimiter)
Splits a string using the specified delimiter, and also trims all the resultant strings in the returned array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String NEWLINE
| Constructor Detail |
|---|
public MiscUtils()
| Method Detail |
|---|
public static StringBuilder escapeStringForCsv(String string,
StringBuilder toAppend)
string - The String to escapetoAppend - The StringBuilder to which the escaped String should be appended
public static StringBuilder padIntToTwoDigits(int i,
StringBuilder toAppend)
i - The value to pad, should be between 0 and 99toAppend - The StringBuilder to which the padded value should be appended
public static String formatDateIso8601(long timeInMillis)
timeInMillis - The time in milliseconds since 1970.
public static String[] splitAndTrim(String stringToSplit,
String delimiter)
stringToSplit - The String to be split, may not be nulldelimiter - The delimiter to use to split the string, may not be null.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||