DurationType

final class DurationType(duration: Duration) extends AnyVal

Provides extension methods to java.time.Duration

class AnyVal
trait Matchable
class Any

Value members

Concrete methods

def *(n: Long): Duration

Gets duration after multiplication.

Gets duration after multiplication.

Value Params
n

number by which duration is multiplied

def +(amount: Duration): Duration

Gets duration with specified amount added.

Gets duration with specified amount added.

Value Params
amount

duration to add

def -(amount: Duration): Duration

Gets duration with specified amount subtracted.

Gets duration with specified amount subtracted.

Value Params
amount

duration to subtract

def /(n: Long): Duration

Gets duration after division.

Gets duration after division.

Value Params
n

number by which duration is divided

def iterateTo(end: Duration, step: Duration): Iterator[Duration]

Creates iterator to end duration (inclusive).

Creates iterator to end duration (inclusive).

Value Params
end

end duration

Throws
IllegalArgumentException

if step is zero.

def iterateUntil(end: Duration, step: Duration): Iterator[Duration]

Creates iterator to end duration (exclusive).

Creates iterator to end duration (exclusive).

Value Params
end

end duration

def max(other: Duration): Duration

Compares to other duration and returns the greater value.

Compares to other duration and returns the greater value.

Value Params
other

other duration

def min(other: Duration): Duration

Compares to other duration and returns the lesser value.

Compares to other duration and returns the lesser value.

Value Params
other

other duration

def unary_-: Duration

Gets negated duration.

Gets negated duration.