Duration
Companion object for Duration type.
Attributes
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Duration.type
Members list
Type members
Classlikes
Exception thrown for invalid duration parsing.
Exception thrown for invalid duration parsing.
Attributes
- Supertypes
-
trait Producttrait Equalsclass Exceptionclass Throwabletrait Serializableclass Objecttrait Matchableclass AnyShow all
Enumeration of time units with their conversion factors and names.
Enumeration of time units with their conversion factors and names.
Attributes
- Supertypes
-
trait Enumtrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Types
Value members
Concrete methods
Converts a Java Duration to a Duration.
Converts a Java Duration to a Duration.
Value parameters
- value
-
The Java Duration to convert
Attributes
- Returns
-
A Duration instance
Creates a Duration from nanoseconds.
Creates a Duration from nanoseconds.
Value parameters
- value
-
The number of nanoseconds
Attributes
- Returns
-
A Duration instance
Converts a Scala Duration to a Duration.
Converts a Scala Duration to a Duration.
Value parameters
- value
-
The Scala Duration to convert
Attributes
- Returns
-
A Duration instance
Creates a Duration from a value and unit.
Creates a Duration from a value and unit.
Value parameters
- unit
-
The unit of time
- value
-
The numeric value
Attributes
- Returns
-
A Duration instance
Parses a string representation of a duration.
Parses a string representation of a duration.
Value parameters
- s
-
The string to parse
Attributes
- Returns
-
A Result containing either the parsed Duration or an InvalidDuration error
Givens
Givens
Extensions
Extensions
Converts the Duration to a human-readable string.
Converts the Duration to a human-readable string.
Attributes
- Returns
-
A string representation of the Duration
Converts the Duration to a Java Duration.
Converts the Duration to a Java Duration.
Attributes
- Returns
-
A Java Duration instance
Converts the Duration to a Scala Duration.
Converts the Duration to a Scala Duration.
Attributes
- Returns
-
A Scala Duration instance