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 text = "[email protected]"
val first: Int = EmailAddress.create(text)
.hashCode()
val second: Int = EmailAddress.create("$first")
.hashCode()
val result: Boolean = first == second
println(result) // true

Calling from Java

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

final String text = "[email protected]";
final EmailAddress first = EmailAddress.Companion.create(text);
final EmailAddress second = EmailAddress.Companion.create(text);
final int firstHashCode = first.hashCode();
final int secondHashCode = second.hashCode();
final boolean result = firstHashCode == secondHashCode;
System.out.println(result); // true