equals
Returns true if the other object is an instance of EmailAddress and has the same string representation as this email address, or returns false otherwise.
Calling from Kotlin
Here's an example of calling this function from Kotlin code:
val value: Any = "[email protected]"
val first: EmailAddress = EmailAddress.fromString(value)
val second: EmailAddress = EmailAddress.fromString(value)
val result: Boolean = first == second // or first.equals(second)
println(result) // trueContent copied to clipboard
Calling from Java
Here's an example of calling this function from Java code:
final Object value = "[email protected]";
final EmailAddress first = EmailAddress.fromString(value);
final EmailAddress second = EmailAddress.fromString(value);
final boolean result = first.equals(second);
System.out.println(result); // trueContent copied to clipboard