isNotEmpty

@JvmName(name = "arrayIsNotEmpty")
fun <T> Validatable<Array<out T>?>.isNotEmpty(): Constraint

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)



@JvmName(name = "collectionIsNotEmpty")
fun <T> Validatable<Collection<T>?>.isNotEmpty(): Constraint

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)

@JvmName(name = "mapIsNotEmpty")
fun <T> Validatable<Map<*, T>?>.isNotEmpty(): Constraint

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)