public class Threads extends Object
| Constructor and Description |
|---|
Threads() |
| Modifier and Type | Method and Description |
|---|---|
void |
rethrowInterrupt(InterruptedException e)
Wraps the given
InterruptedException in an UncheckedInterruptedException and re-interrupts the
thread.Remember to add @SuppressWarnings("squid:S2142") to the catch clause. |
void |
sleep(int milliSeconds) |
void |
waitUntil(BooleanSupplier state,
Object semaphore) |
public void sleep(int milliSeconds)
UncheckedInterruptedException - If the thread was interrupted.public void waitUntil(BooleanSupplier state, Object semaphore)
UncheckedInterruptedException - If the thread was interrupted.IllegalMonitorStateException - If the current thread is not the owner of the object's monitorpublic void rethrowInterrupt(InterruptedException e)
InterruptedException in an UncheckedInterruptedException and re-interrupts the
thread.@SuppressWarnings("squid:S2142") to the catch clause. Otherwise, Sonar will complain
about not interrupting the thread.UncheckedInterruptedException - Wrapping the given InterruptedException.Copyright © 2018. All rights reserved.