equals

operator override fun equals(other: Any?): Boolean

Returns true if the other object is an instance of EmailAddressRegex with the same string representation, or returns false otherwise.


Calling from Kotlin

Here's an example of calling this function from Kotlin code:

val regex: EmailAddressRegex = EmailAddressRegex.default()
val other: EmailAddressRegex = EmailAddressRegex.default()
val result: Boolean = regex == other // or regex.equals(other)
val message = "Regular expressions with the same pattern are equal."
assertTrue(result, message)

Calling from Java

Here's an example of calling this function from Java code:

final EmailAddressRegex regex = EmailAddressRegex.defaultPattern();
final EmailAddressRegex other = EmailAddressRegex.defaultPattern();
final boolean result = regex.equals(other);
final String message =
        "Regular expressions with the same pattern are equal.";
Assertions.assertTrue(result, message);