public final class DebugUtil
extends java.lang.Object
debug("Done with step ", step, " after ", time, " seconds");
The reason for doing things like this is to avoid the overhead of string concatenation if it is not necessary.| Modifier and Type | Field and Description |
|---|---|
static boolean |
OUTPUT_ENABLED |
| Modifier and Type | Method and Description |
|---|---|
static void |
debug()
Generate a debug message.
|
static void |
debug(java.lang.Object... objs)
Generate a debug message.
|
static void |
debug(java.lang.Object obj)
Generate a debug message.
|
static void |
debug(java.lang.Object obj1,
java.lang.Object obj2)
Generate a debug message.
|
static void |
debug(java.lang.Object obj1,
java.lang.Object obj2,
java.lang.Object obj3)
Generate a debug message.
|
static void |
debug(java.lang.Object obj1,
java.lang.Object obj2,
java.lang.Object obj3,
java.lang.Object obj4)
Generate a debug message.
|
static void |
debug(java.lang.Object obj1,
java.lang.Object obj2,
java.lang.Object obj3,
java.lang.Object obj4,
java.lang.Object obj5)
Generate a debug message.
|
static void |
debug(java.lang.Object obj1,
java.lang.Object obj2,
java.lang.Object obj3,
java.lang.Object obj4,
java.lang.Object obj5,
java.lang.Object obj6)
Generate a debug message.
|
static void |
debug(java.lang.Object obj1,
java.lang.Object obj2,
java.lang.Object obj3,
java.lang.Object obj4,
java.lang.Object obj5,
java.lang.Object obj6,
java.lang.Object obj7)
Generate a debug message.
|
static void |
debug(java.lang.Object obj1,
java.lang.Object obj2,
java.lang.Object obj3,
java.lang.Object obj4,
java.lang.Object obj5,
java.lang.Object obj6,
java.lang.Object obj7,
java.lang.Object obj8)
Generate a debug message.
|
static void |
debug(java.lang.String message)
Generate a debug message if debugging output is enabled.
|
static void |
debugFormat(java.lang.String format,
java.lang.Object... args)
Generate a formatted debug message if debugging output is enabled.
|
public static void debugFormat(java.lang.String format,
java.lang.Object... args)
String.format(java.lang.String, java.lang.Object...) and the result is printed with a newline appended.format - The format stringargs - Formatting argumentsString.format(java.lang.String, java.lang.Object...)public static void debug(java.lang.String message)
message - The messagepublic static void debug()
debug("");
public static void debug(java.lang.Object obj)
debug(java.util.Objects.toString(obj));
obj - The object to printpublic static void debug(java.lang.Object obj1,
java.lang.Object obj2)
debug(java.util.Objects.toString(obj1) + java.util.Objects.toString(obj2));
obj1 - The first object to printobj2 - The second object to printpublic static void debug(java.lang.Object obj1,
java.lang.Object obj2,
java.lang.Object obj3)
debug(Objects.toString(obj1) + Objects.toString(obj2) + Objects.toString(obj3));
obj1 - The first object to printobj2 - The second object to printobj3 - The third object to printpublic static void debug(java.lang.Object obj1,
java.lang.Object obj2,
java.lang.Object obj3,
java.lang.Object obj4)
debug(Objects.toString(obj1) + Objects.toString(obj2) + Objects.toString(obj3) + Objects.toString(obj4));
obj1 - The first object to printobj2 - The second object to printobj3 - The third object to printobj4 - The fourth object to printpublic static void debug(java.lang.Object obj1,
java.lang.Object obj2,
java.lang.Object obj3,
java.lang.Object obj4,
java.lang.Object obj5)
debug(Objects.toString(obj1) + Objects.toString(obj2) + Objects.toString(obj3)
+ Objects.toString(obj4) + Objects.toString(obj5));
obj1 - The first object to printobj2 - The second object to printobj3 - The third object to printobj4 - The fourth object to printobj5 - The fifth object to printpublic static void debug(java.lang.Object obj1,
java.lang.Object obj2,
java.lang.Object obj3,
java.lang.Object obj4,
java.lang.Object obj5,
java.lang.Object obj6)
debug(Objects.toString(obj1) + Objects.toString(obj2) + Objects.toString(obj3)
+ Objects.toString(obj4) + Objects.toString(obj5) + Objects.toString(obj6));
obj1 - The first object to printobj2 - The second object to printobj3 - The third object to printobj4 - The fourth object to printobj5 - The fifth object to printobj6 - The sixth object to printpublic static void debug(java.lang.Object obj1,
java.lang.Object obj2,
java.lang.Object obj3,
java.lang.Object obj4,
java.lang.Object obj5,
java.lang.Object obj6,
java.lang.Object obj7)
debug(Objects.toString(obj1) + Objects.toString(obj2) + Objects.toString(obj3)
+ Objects.toString(obj4) + Objects.toString(obj5) + Objects.toString(obj6) + Objects.toString(obj7));
obj1 - The first object to printobj2 - The second object to printobj3 - The third object to printobj4 - The fourth object to printobj5 - The fifth object to printobj6 - The sixth object to printobj7 - The seventh object to printpublic static void debug(java.lang.Object obj1,
java.lang.Object obj2,
java.lang.Object obj3,
java.lang.Object obj4,
java.lang.Object obj5,
java.lang.Object obj6,
java.lang.Object obj7,
java.lang.Object obj8)
debug(Objects.toString(obj1) + Objects.toString(obj2) + Objects.toString(obj3) + Objects.toString(obj4)
+ Objects.toString(obj5) + Objects.toString(obj6) + Objects.toString(obj7) + Objects.toString(obj8));
obj1 - The first object to printobj2 - The second object to printobj3 - The third object to printobj4 - The fourth object to printobj5 - The fifth object to printobj6 - The sixth object to printobj7 - The seventh object to printobj8 - The eight object to printpublic static void debug(java.lang.Object... objs)
StringBuilder sb = new StringBuilder();
for (Object o : objs)
sb.append(java.util.Objects.toString(o));
debug(sb.toString();
objs - The objects to print