public static Duration valueOf (String time)

Factory method that returns a Duration instance for a specified amount of time. The syntax is "[number][ms|s|m|h]".

Parameters:
time    A non-null string properly formatted. Leading or trailing spaces will not parse correctly. Throws a NullPointerException if time is null.

Returns:  a Duration which is represented by the time