token-bucket icon indicating copy to clipboard operation
token-bucket copied to clipboard

Use the newer java.time.Duration to represent duration

Open gehel opened this issue 7 years ago • 0 comments

Up to now the code used (or abused) java.util.concurrent.TimeUnit. Duration is a better representation, which encapsulate the amount and the unit in a single class.

Method using TimeUnit have been deprecated and delegate to the new methods using Duration. A dependency to threeten-extra has been added to do this conversion. It can be removed once all TimeUnit based methods have been removed.

Pushed minimum compiler version to 1.8 to allow the use of Duration.

gehel avatar Jul 27 '17 12:07 gehel