Transform a Scala FiniteDuration into a Java duration.
Transform a Scala FiniteDuration into a Java duration. Note that the Scala duration keeps the time unit it was created with while a Java duration always is a pair of seconds and nanos, so the unit it lost.
Transform a Java duration into a Scala duration.
Transform a Java duration into a Scala duration. If the nanosecond part of the Java duration is zero the returned duration will have a time unit of seconds and if nthere is a nanoseconds part the Scala duration will have a time unit of nanoseconds.
IllegalArgumentException If the given Java Duration is out of bounds of what can be expressed with the
Scala FiniteDuration.
This class contains static methods which convert between Java Durations and the durations from the Scala concurrency package. This is useful when mediating between Scala and Java libraries with asynchronous APIs where timeouts for example are often expressed as durations.