hasSizeGreaterThanOrEqualTo

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

The validatable Array must have a size greater than or equal to size when this constraint is applied.

Code example:

val validate = Validator<Array<Char>> { hasSizeGreaterThanOrEqualTo(2) }
validate(arrayOf('a', 'b', 'c')) // Success
validate(arrayOf('a', 'b')) // Success
validate(arrayOf('a')) // Failure (message: The number of items must be greater than or equal to 2)

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

The validatable Collection must have a size greater than or equal to size when this constraint is applied.

Code example:

val validate = Validator<Collection<Char>> { hasSizeGreaterThanOrEqualTo(2) }
validate(listOf('a', 'b', 'c')) // Success
validate(listOf('a', 'b')) // Success
validate(listOf('a')) // Failure (message: The number of items must be greater than or equal to 2)

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

The validatable Map must have a size greater than or equal to size when this constraint is applied.

Code example:

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