Companion

object Companion

Functions

Link copied to clipboard
fun between(fromTime: Instant, untilTime: Instant): TimeWindow

Creates a TimeWindow with the time interval [fromTime, untilTime). midpoint will return fromTime + (untilTime - fromTime) / 2.

Link copied to clipboard
fun fromOnly(fromTime: Instant): TimeWindow

Creates a TimeWindow with null untilTime, i.e. the time interval [fromTime, ∞). midpoint will return null.

Link copied to clipboard
fun fromStartAndDuration(fromTime: Instant, duration: Duration): TimeWindow

Creates a TimeWindow with the time interval [fromTime, fromTime + duration). midpoint will return fromTime + duration / 2

Link copied to clipboard
fun untilOnly(untilTime: Instant): TimeWindow

Creates a TimeWindow with null fromTime, i.e. the time interval (∞, untilTime). midpoint will return null.

Link copied to clipboard
fun withTolerance(instant: Instant, tolerance: Duration): TimeWindow

Creates a TimeWindow which is centered around instant with the given tolerance on both sides, i.e the time interval [instant - tolerance, instant + tolerance). midpoint will return instant.