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