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