hashCode

override fun hashCode(): Int

Returns a hash code value for this email address.


Calling from Kotlin

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

val text = "[email protected]"
val first: EmailAddress = EmailAddress.orThrow(text)
val second: EmailAddress = EmailAddress.orThrow(text)
val actual: Boolean = first.hashCode() == second.hashCode()
assertTrue(actual)

Calling from Java

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

final String text = "[email protected]";
final int first = EmailAddress.orThrow(text)
.hashCode();
final int second = EmailAddress.orThrow(text)
.hashCode();
final boolean actual = first == second;
Assertions.assertTrue(actual);