Duration isPositive missing?
Roger.Riggs at Oracle.com
Fri Dec 16 18:26:34 UTC 2016
Yes, it does seem like an oversight. There are some other alternatives
that might be considered.
.toMillis() > 0 // Might throw an exception for very large or
I create an issue: 8171382 java.time.Duration missing isPositive method
To look at it for the next release.
On 12/16/2016 12:54 PM, Steven Schlansker wrote:
> Hi core-libs-dev,
> My coworker and I were just puzzling over the seemingly trivially missing
> There are already "isNegative" and "isZero" -- but for isPositive the best
> we came up with were awful things like
> !isZero() && !isNegative()
> .compareTo(Duration.ZERO) > 0
> but all of these feel way worse than a simple isPositive method.
> Can you shed some light as to why this is missing?
More information about the core-libs-dev