Closed kashike closed 4 years ago
Sure, I can do it, maybe with a small wildcard limit modification on the collection parameter.
Just one question: Have you also noticed the possibility to simply pass all necessary units as var-arg-array instead of first collecting them? For example:
Duration<IsoUnit> duration =
Duration.in(DAYS, HOURS, MINUTES).between(start, end);
Yes, but in my case I have a pre-existing Set
of the units I want to use, and am converting them to an array manually. Passing an array around is not that nice, especially since mutable.
Ok, I have committed some code changes for the next release v5.6. I cannot yet say when it will be released because I still need some time for finishing the old Hindu calendar but your RFE is on the road. Thanks for feedback.
Thank you for the speedy addition, @MenoData!
Hi there! A bit of a simple request, but do you think you could add a
Collection
-variant ofDuration.in(U)
? It is nicer to pass around a collection instead of an array in my code, so I made a helper method to do this, but figured I am probably not the only one.public static <U extends IsoUnit> TimeMetric<U, Duration<U>> in(Collection<U> units)