Is it possible to parse String in FiniteDuration in Scala without writing special code?
Duration has a Duration method that accepts create , which accepts a String , however it creates a Duration and is not sure how to use it to create a FiniteDuration . There are several factory methods on Duration that produce FiniteDuration instances, but that implies that I have to parse my string to create their parameters (their signature expects long and a TimeUnit ).
These types that I mention are related to scala.concurrent.duration .
Thanks.
scala duration
user2916547
source share