isEqualTo
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")
Content copied to clipboard
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")
Content copied to clipboard