isContaining
The validatable Array must contain element when this constraint is applied.
Code example:
val validate = Validator<Array<Char>> { isContaining('b') }
validate(arrayOf('a', 'b', 'c')) // Success
validate(emptyArray()) // Failure (message: Must contain "b")
Content copied to clipboard
The validatable Iterable must contain element when this constraint is applied.
Code example:
val validate = Validator<Iterable<Char>> { isContaining('b') }
validate(listOf('a', 'b', 'c')) // Success
validate(emptyList()) // Failure (message: Must contain "b")
Content copied to clipboard