Summary
Provide isPositive() method in java.time.Duration.
Problem
There are isNegative() and isZero() methods in the class, but missing isPositive().
Solution
Add isPositive() method for completeness.
Specification
Add the following isPositive() method in java.time.Duration class.
/**
* Checks if this duration is positive, excluding zero.
* <p>
* A {@code Duration} represents a directed distance between two points on
* the time-line and can therefore be positive, zero or negative.
* This method checks whether the length is greater than zero.
*
* @return true if this duration has a total length greater than zero
* @since 18
*/
public boolean isPositive()
- csr of
-
JDK-8171382 java.time.Duration missing isPositive method
-
- Resolved
-