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