DurationMethods

final implicit class DurationMethods(duration: Duration) extends AnyVal

Provides extension methods for 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 parameters:
n

number by which duration is multiplied

def +(amount: Duration): Duration

Gets duration with specified amount added.

Gets duration with specified amount added.

Value parameters:
amount

duration to add

def -(amount: Duration): Duration

Gets duration with specified amount subtracted.

Gets duration with specified amount subtracted.

Value parameters:
amount

duration to subtract

def /(n: Long): Duration

Gets duration after division.

Gets duration after division.

Value parameters:
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 parameters:
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 parameters:
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 parameters:
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 parameters:
other

other duration

def unary_-: Duration

Gets negated duration.

Gets negated duration.