FixedClock

A clock with a fixed time, suitable for testing.

class FixedClock(instant: Instant,zone: TimeZone) : Clock

Parameters

instant

the initial instant that the clock should be set to

zone

the time zone

Constructors

FixedClock
Link copied to clipboard
common

the initial instant that the clock should be set to

fun FixedClock(instant: Instant, zone: TimeZone)

Functions

equals
Link copied to clipboard
common
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open override fun hashCode(): Int
minusAssign
Link copied to clipboard
common
operator fun minusAssign(days: LongDays)
operator fun minusAssign(days: IntDays)
operator fun minusAssign(hours: LongHours)
operator fun minusAssign(hours: IntHours)
operator fun minusAssign(minutes: LongMinutes)
operator fun minusAssign(minutes: IntMinutes)
operator fun minusAssign(seconds: LongSeconds)
operator fun minusAssign(seconds: IntSeconds)
operator fun minusAssign(milliseconds: LongMilliseconds)
operator fun minusAssign(milliseconds: IntMilliseconds)
operator fun minusAssign(microseconds: LongMicroseconds)
operator fun minusAssign(microseconds: IntMicroseconds)
operator fun minusAssign(nanoseconds: LongNanoseconds)
operator fun minusAssign(nanoseconds: IntNanoseconds)
plusAssign
Link copied to clipboard
common
operator fun plusAssign(days: LongDays)
operator fun plusAssign(days: IntDays)
operator fun plusAssign(hours: LongHours)
operator fun plusAssign(hours: IntHours)
operator fun plusAssign(minutes: LongMinutes)
operator fun plusAssign(minutes: IntMinutes)
operator fun plusAssign(seconds: LongSeconds)
operator fun plusAssign(seconds: IntSeconds)
operator fun plusAssign(milliseconds: LongMilliseconds)
operator fun plusAssign(milliseconds: IntMilliseconds)
operator fun plusAssign(microseconds: LongMicroseconds)
operator fun plusAssign(microseconds: IntMicroseconds)
operator fun plusAssign(nanoseconds: LongNanoseconds)
operator fun plusAssign(nanoseconds: IntNanoseconds)
readInstant
Link copied to clipboard
common

Reads the current Instant.

open override fun readInstant(): Instant
readMilliseconds
Link copied to clipboard
common

Reads the current number of milliseconds that have elapsed since the Unix epoch of 1970-01-01T00:00 in UTC.

open override fun readMilliseconds(): LongMilliseconds
readPlatformInstant
Link copied to clipboard
common

Reads the current PlatformInstant.

open override fun readPlatformInstant(): PlatformInstant
setTo
Link copied to clipboard
common
fun setTo(instant: Instant)
toString
Link copied to clipboard
common
open override fun toString(): String

Properties

zone
Link copied to clipboard
common

the time zone

open override val zone: TimeZone