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