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 text: Any = "[email protected]"
val first: EmailAddress = EmailAddress.fromString(text)
val second: EmailAddress = EmailAddress.fromString(text)
val actual: Boolean = first == second // or first.equals(second)
assertTrue(actual)
Content copied to clipboard
Calling from Java
Here's an example of calling this function from Java code:
final Object text = "[email protected]";
final EmailAddress first = EmailAddress.fromString(text);
final EmailAddress second = EmailAddress.fromString(text);
final boolean actual = first.equals(second);
Assertions.assertTrue(actual);
Content copied to clipboard