public final class StackUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
equals(StackTraceElement[] ste1,
StackTraceElement[] ste2,
boolean lineNumbers)
Tests the equality of two stacktraces.
|
static boolean |
equals(StackTraceElement ste1,
StackTraceElement ste2,
boolean lineNumbers)
Tests the equality of two
StackTraceElements. |
static Throwable |
getDebuggingThrowable()
Creates a
Throwable whose first (topmost) element is the line of the calling method. |
static String |
getMethodName()
Gets the name of the method that calls this method.
|
static String |
getMethodName(boolean canonicalName,
boolean printValues,
Object... paramInstances)
Gets the name of the method that calls this method.
|
static String |
getMethodName(boolean canonicalName,
Object... paramInstances)
Gets the name of the method that calls this method.
|
static String |
getMethodName(Object... paramInstances)
Gets the name of the method that calls this method.
|
public static String getMethodName()
getMethodName(boolean, boolean, java.lang.Object[]) with false as value for the
canonicalName and pringValues parameter and null as value for the
paramInstances parameter.getMethodName(boolean, boolean, java.lang.Object[])public static String getMethodName(Object... paramInstances)
getMethodName(boolean, boolean, java.lang.Object[]) with false as value for the
canonicalName and pringValues parameter.paramInstances - the parameters that shall be printed with this method namegetMethodName(boolean, boolean, java.lang.Object[])public static String getMethodName(boolean canonicalName, Object... paramInstances)
getMethodName(boolean, boolean, java.lang.Object[]) with false as value for the
pringValues parameter.canonicalName - whether the class names of the paramInstances shall be canonical or simpleparamInstances - the parameters that shall be printed with this method namegetMethodName(boolean, boolean, java.lang.Object[])public static String getMethodName(boolean canonicalName, boolean printValues, Object... paramInstances)
Class), too, depending on the canonicalName flag, e.g.myShinyMethod(String,boolean) if canonicalName is false.printValues is true it additionally appends the results of the
toString() operations of the single methods like so:myShinyMethod(String{myString}).canonicalName - whether the class names of the paramInstances shall be canonical or simpleprintValues - whether the actual values of the paramInstances shall be printedparamInstances - the parameters that shall be printed with this method namepublic static Throwable getDebuggingThrowable()
Throwable whose first (topmost) element is the line of the calling method. As the name
suggests this operation should only be used for debugging purposes.Throwable whose first (topmost) element is the line of the calling methodpublic static boolean equals(StackTraceElement[] ste1, StackTraceElement[] ste2, boolean lineNumbers)
equals(java.lang.StackTraceElement, java.lang.StackTraceElement, boolean)ste1 - first stacktraceste2 - second stacktracelineNumbers - if line numbers shall be included in the equality checktrue if the stacktraces are equal, false otherwiseIllegalArgumentException - if at least one argument is nullpublic static boolean equals(StackTraceElement ste1, StackTraceElement ste2, boolean lineNumbers)
StackTraceElements. Two elements are considered equal if their method,
classname and filename are equal. Optionally the equality check is done also for their line numbers.ste1 - first StackTraceElementste2 - seconed StackTraceElementlineNumbers - if true line numbers are included in the equality checktrue if the StackTraceElements are equal, false otherwiseIllegalArgumentException - if any of the arguments is nullCopyright © 2012–2026 cismet GmbH. All rights reserved.