isNotEmpty
The validatable Array must not be empty when this constraint is applied.
Code example:
val validate = Validator<Array<Char>> { isEmpty() }
validate(emptyArray()) // Success
validate(arrayOf('a', 'b', 'c')) // Failure (message: Must be empty)
Content copied to clipboard
The validatable Collection must not be empty when this constraint is applied.
Code example:
val validate = Validator<Collection<Char>> { isEmpty() }
validate(emptyList()) // Success
validate(listOf('a', 'b', 'c')) // Failure (message: Must be empty)
Content copied to clipboard
The validatable Map must not be empty when this constraint is applied.
Code example:
val validate = Validator<Map<Char, Int>> { isEmpty() }
validate(emptyMap()) // Success
validate(mapOf('a' to 1, 'b' to 2, 'c' to 3)) // Failure (message: Must be empty)
Content copied to clipboard