public enum Jvm extends Enum<Jvm>
| Modifier and Type | Field and Description |
|---|---|
static boolean |
IS_DEBUG |
| Modifier and Type | Method and Description |
|---|---|
static void |
busyWaitMicros(long micros)
This method is designed tobe used when the time to be
waited is very small, typically under a millisecond.
|
static Field |
getField(Class clazz,
String name)
Get the Field for a class by name.
|
static <V> V |
getValue(Object obj,
String name) |
static boolean |
isDebug() |
static String |
lockWithStack(ReentrantLock lock)
Log the stack trace of the thread holding a lock.
|
static void |
pause(long millis)
Silently pause for milli seconds.
|
static <T extends Throwable> |
rethrow(Throwable throwable)
Cast a CheckedException as an unchecked one.
|
static int |
trimLast(int first,
StackTraceElement[] stes) |
static void |
trimStackTrace(StringBuilder sb,
StackTraceElement... stes)
Append the StackTraceElements to the StringBuilder trimming some internal methods.
|
static Jvm |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Jvm[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static Jvm[] values()
for (Jvm c : Jvm.values()) System.out.println(c);
public static Jvm valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static <T extends Throwable> RuntimeException rethrow(Throwable throwable) throws T extends Throwable
T - the type of the Throwablethrowable - to castT - the throwable as an unchecked throwableT extends Throwablepublic static void trimStackTrace(StringBuilder sb, StackTraceElement... stes)
sb - to append tostes - stack trace elementspublic static int trimLast(int first,
StackTraceElement[] stes)
public static boolean isDebug()
public static void pause(long millis)
millis - to sleep for.public static void busyWaitMicros(long micros)
micros - Time in microspublic static Field getField(Class clazz, String name)
clazz - to get the field forname - of the fieldpublic static String lockWithStack(ReentrantLock lock)
lock - to logCopyright © 2016. All rights reserved.