public class DebugUtils
extends java.lang.Object
This static class provides various utility methods for printing debugging information.
Modifier | Constructor and Description |
---|---|
protected |
DebugUtils()
Don't allow instantiation, do allow overrides.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
activeThreads()
Get list of active threads.
|
static java.lang.String |
getStackTrace(java.lang.Throwable e)
Gets a stack trace for an exception.
|
static void |
printArray(java.lang.String arrayLabel,
java.lang.Object[] array)
Debugging support -- Print contents of an array.
|
static java.awt.Component |
printChildComponents(java.awt.Container parent,
int indent)
Prints child components of a component.
|
static <K,V> void |
printMap(java.lang.String mapLabel,
java.util.Map<K,V> map)
Debugging support -- Print contents of a map (HashMap, TreeMap, etc.).
|
static void |
printMemoryStatus(java.lang.String title)
Print current memory status.
|
static void |
printNullity(java.lang.String methodName,
java.lang.String objectName,
java.lang.Object object)
Debugging support -- Print message to System.out telling if object is null or not.
|
static void |
printThreads()
Prints current thread list.
|
public static java.lang.String activeThreads()
public static java.lang.String getStackTrace(java.lang.Throwable e)
e
- The exceptionpublic static java.awt.Component printChildComponents(java.awt.Container parent, int indent)
parent
- The parent component.public static void printNullity(java.lang.String methodName, java.lang.String objectName, java.lang.Object object)
methodName
- Name of calling method.objectName
- Name of object to inspect.object
- The named object to inspect.public static <K,V> void printMap(java.lang.String mapLabel, java.util.Map<K,V> map)
mapLabel
- Label for map.map
- The map to print.
N.B. This method assumes both the keys and values have toString() methods.
public static void printArray(java.lang.String arrayLabel, java.lang.Object[] array)
arrayLabel
- Label for array.array
- The array to print.
N.B. This method assumes the array values have toString() methods.
public static void printMemoryStatus(java.lang.String title)
public static void printThreads()