Class ThreadUtils

java.lang.Object
com.igormaznitsa.meta.common.utils.ThreadUtils

public final class ThreadUtils extends Object
Auxiliary methods for thread processing.
Since:
1.0
  • Constructor Details

    • ThreadUtils

      private ThreadUtils()
  • Method Details

    • silentSleep

      @Weight(VARIABLE) public static boolean silentSleep(long milliseconds)
      Just suspend the current thread for defined interval in milliseconds.
      Parameters:
      milliseconds - milliseconds to sleep
      Returns:
      false if the sleep has been interrupted by InterruptedException, true otherwise.
      Since:
      1.0
      See Also:
    • stackElement

      @Weight(VARIABLE) public static StackTraceElement stackElement()
      Get the stack element of the method caller.
      Returns:
      the stack trace element for the calling method.
      Since:
      1.0
    • stackDepth

      @Weight(VARIABLE) public static int stackDepth()
      Get the stack call depth for the caller.
      Returns:
      the caller method stack depth.
      Since:
      1.0