isNotIdenticalTo
The validatable value must not be identical to other when this constraint is applied.
The values are considered not identical if they are not referentially equal.
Code example:
data object Foo
data object Bar
val validate = Validator<Any> { isNotIdenticalTo(Foo) }
validate(Bar) // Success
validate(Foo) // Failure (message: Must not be identical to "Foo")
Content copied to clipboard