hasSizeNotEqualTo

@JvmName(name = "arrayHasSizeNotEqualTo")
fun <T> Validatable<Array<out T>?>.hasSizeNotEqualTo(size: Int): Constraint

The validatable Array must have a size different from size when this constraint is applied.

Code example:

val validate = Validator<Array<Char>> { hasSizeNotEqualTo(3) }
validate(arrayOf('a', 'b')) // Success
validate(arrayOf('a', 'b', 'c')) // Failure (message: The number of items must be different from 3)

@JvmName(name = "collectionHasSizeNotEqualTo")
fun <T> Validatable<Collection<T>?>.hasSizeNotEqualTo(size: Int): Constraint

The validatable Collection must have a size different from size when this constraint is applied.

Code example:

val validate = Validator<Collection<Char>> { hasSizeNotEqualTo(3) }
validate(listOf('a', 'b')) // Success
validate(listOf('a', 'b', 'c')) // Failure (message: The number of items must be different from 3)

@JvmName(name = "mapHasSizeNotEqualTo")
fun <T> Validatable<Map<*, T>?>.hasSizeNotEqualTo(size: Int): Constraint

The validatable Map must have a size different from size when this constraint is applied.

Code example:

val validate = Validator<Map<Char, Int>> { hasSizeNotEqualTo(3) }
validate(mapOf('a' to 1, 'b' to 2)) // Success
validate(mapOf('a' to 1, 'b' to 2, 'c' to 3)) // Failure (message: The number of items must be different from 3)