FakeClock.Builder
class FakeClock.Builder
A builder for FakeClock instances.
Summary
Public functions |
|
|---|---|
FakeClock! |
build()Builds a |
FakeClock.Builder! |
@CanIgnoreReturnValueSets the time the system was booted since the Unix Epoch, in milliseconds. |
FakeClock.Builder! |
@CanIgnoreReturnValueSets the initial elapsed time since the boot time, in milliseconds. |
FakeClock.Builder! |
@CanIgnoreReturnValueSets whether the clock should automatically advance the time to the time of the next message that is due to be sent. |
FakeClock.Builder! |
@CanIgnoreReturnValueSets the maximum time difference between two messages that the fake clock will automatically advance. |
Public functions
setBootTimeMs
@CanIgnoreReturnValue
fun setBootTimeMs(bootTimeMs: Long): FakeClock.Builder!
Sets the time the system was booted since the Unix Epoch, in milliseconds.
The default value is 0.
| Parameters | |
|---|---|
bootTimeMs: Long |
The time the system was booted since the Unix Epoch, in milliseconds. |
| Returns | |
|---|---|
FakeClock.Builder! |
This builder. |
setInitialTimeMs
@CanIgnoreReturnValue
fun setInitialTimeMs(initialTimeMs: Long): FakeClock.Builder!
Sets the initial elapsed time since the boot time, in milliseconds.
The default value is 0.
| Parameters | |
|---|---|
initialTimeMs: Long |
The initial elapsed time since the boot time, in milliseconds. |
| Returns | |
|---|---|
FakeClock.Builder! |
This builder. |
setIsAutoAdvancing
@CanIgnoreReturnValue
fun setIsAutoAdvancing(isAutoAdvancing: Boolean): FakeClock.Builder!
Sets whether the clock should automatically advance the time to the time of the next message that is due to be sent.
The default value is false.
| Parameters | |
|---|---|
isAutoAdvancing: Boolean |
Whether the clock should automatically advance the time. |
| Returns | |
|---|---|
FakeClock.Builder! |
This builder. |
setMaxAutoAdvancingTimeDiffMs
@CanIgnoreReturnValue
fun setMaxAutoAdvancingTimeDiffMs(maxAutoAdvancingTimeDiffMs: Long): FakeClock.Builder!
Sets the maximum time difference between two messages that the fake clock will automatically advance.
The default value is DEFAULT_MAX_AUTO_ADVANCING_TIME_DIFF_MS.
| Parameters | |
|---|---|
maxAutoAdvancingTimeDiffMs: Long |
The maximum time difference in milliseconds. |
| Returns | |
|---|---|
FakeClock.Builder! |
This builder. |