Package com.google.api.client.util
Interface Sleeper
- All Known Implementing Classes:
MockSleeper
public interface Sleeper
Sleeper interface to use for requesting the current thread to sleep as specified in
Thread.sleep(long)
.
The default implementation can be accessed at DEFAULT
. Primarily used for testing.
- Since:
- 1.14
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Sleeper
Provides the default implementation based onThread.sleep(long)
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
sleep
(long millis) Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds as specified inThread.sleep(long)
.
-
Field Details
-
DEFAULT
Provides the default implementation based onThread.sleep(long)
.
-
-
Method Details
-
sleep
Causes the currently executing thread to sleep (temporarily cease execution) for the specified number of milliseconds as specified inThread.sleep(long)
.- Parameters:
millis
- length of time to sleep in milliseconds- Throws:
InterruptedException
- if any thread has interrupted the current thread
-