isEqualTo

fun <T> Validatable<T?>.isEqualTo(other: T?): Constraint

The validatable value must be equal to other when this constraint is applied.

Code example:

val validate = Validator<String> { isEqualTo("foo") }
validate("foo") // Success
validate("bar") // Failure (message: Must be equal to "foo")

The validatable value must be equal to other when this constraint is applied.

Code example:

val validate = Validator<Pair<String, String>> { first.isEqualTo(second) }
validate("foo" to "foo") // Success
validate("foo" to "bar") // Failure (message: Must be equal to "bar")