hashCode

override fun hashCode(): Int

Returns a hash code value for this email address.


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.hashCode() == second.hashCode()
println(result) // true

Calling from Java

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

final Object value = "[email protected]";
final int first = EmailAddress.fromString(value)
.hashCode();
final int second = EmailAddress.fromString(value)
.hashCode();
final boolean result = first == second;
System.out.println(result); // true