isPositive
The validatable Duration must be positive when this constraint is applied.
Code example:
val validate = Validator<Duration> { isPositive() }
validate(1.seconds) // Success
validate(0.seconds) // Failure (message: Must be positive)
validate((-1).seconds) // Failure (message: Must be positive)
Content copied to clipboard