|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.websphere.ras.DataFormatHelper
public class DataFormatHelper
Utilities which provide formatting for date strings (NCSA compliant dates used in trace records), and padded thread ids, etc.
Constructor Summary | |
---|---|
DataFormatHelper()
|
Method Summary | |
---|---|
static java.lang.String |
escape(java.lang.String src)
Escapes characters in the input string that would interfere with formatting |
static java.lang.String |
formatCurrentTime()
Return the current time formatted as "dd/MMM/yyyy HH:mm:ss:SSS Z" |
static java.lang.String |
formatTime(long timestamp)
Return the given time formatted as "dd/MMM/yyyy HH:mm:ss:SSS Z" |
static java.lang.String |
getThreadId()
Get and return the thread id, padded to 8 characters. |
static java.lang.String |
padHexString(int num,
int width)
Returns the provided integer, padded to the specified number of characters with zeros. |
static java.lang.String |
throwableToString(java.lang.Throwable t)
Returns a string containing the formatted exception stack |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DataFormatHelper()
Method Detail |
---|
public static final java.lang.String formatCurrentTime()
public static final java.lang.String formatTime(long timestamp)
timestamp
- A timestamp as a long, e.g. what would be returned from
System.currentTimeMillis()
public static final java.lang.String getThreadId()
public static final java.lang.String padHexString(int num, int width)
num
- Input number as an integerwidth
- Number of characters to return, including padding
public static final java.lang.String throwableToString(java.lang.Throwable t)
t
- throwable
public static final java.lang.String escape(java.lang.String src)
src
- input string to be escaped
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |